Simplify DIALOG_SHIM::SetSizeInDU()

I missed in the wx documentation that ConvertDialogToPixels() has a
wxSize overload.
This commit is contained in:
Chris Pavlina 2018-01-06 14:51:07 -07:00
parent 13bc706518
commit 4d3b16bbd9
1 changed files with 4 additions and 6 deletions

View File

@ -117,23 +117,21 @@ void DIALOG_SHIM::FinishDialogSettings()
void DIALOG_SHIM::SetSizeInDU( int x, int y )
{
wxPoint sz( x, y );
auto pixels_as_point = ConvertDialogToPixels( sz );
wxSize pixels_as_size( pixels_as_point.x, pixels_as_point.y );
SetSize( pixels_as_size );
wxSize sz( x, y );
SetSize( ConvertDialogToPixels( sz ) );
}
int DIALOG_SHIM::HorizPixelsFromDU( int x )
{
wxPoint sz( x, 0 );
wxSize sz( x, 0 );
return ConvertDialogToPixels( sz ).x;
}
int DIALOG_SHIM::VertPixelsFromDU( int y )
{
wxPoint sz( 0, y );
wxSize sz( 0, y );
return ConvertDialogToPixels( sz ).y;
}