Don't use wxScreenDC as this returns "a" screen but not "the" screen

Windows supports per-monitor and per-app DPI. wxScreenDC is unable to resolve the actual DPI setting since it has no window context.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/10681
This commit is contained in:
Marek Roszko 2022-03-13 23:31:06 -04:00
parent d74a0cdaa3
commit 605dd8a580
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ EDA_MSG_PANEL::~EDA_MSG_PANEL()
int EDA_MSG_PANEL::GetRequiredHeight( wxWindow* aWindow ) int EDA_MSG_PANEL::GetRequiredHeight( wxWindow* aWindow )
{ {
wxSize fontSizeInPixels; wxSize fontSizeInPixels;
wxScreenDC dc; wxWindowDC dc( aWindow );
dc.SetFont( KIUI::GetControlFont( aWindow ) ); dc.SetFont( KIUI::GetControlFont( aWindow ) );
dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y ); dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y );