From af4a4cbc0814192092ff4194ad3e898d8641c50e Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 13 Mar 2022 23:31:06 -0400 Subject: [PATCH] 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 (cherry picked from commit 605dd8a580f5fab1cc0a4face6d063c4a4a64939) --- common/widgets/msgpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/widgets/msgpanel.cpp b/common/widgets/msgpanel.cpp index 93de5ae29e..6db0a02563 100644 --- a/common/widgets/msgpanel.cpp +++ b/common/widgets/msgpanel.cpp @@ -63,7 +63,7 @@ EDA_MSG_PANEL::~EDA_MSG_PANEL() int EDA_MSG_PANEL::GetRequiredHeight( wxWindow* aWindow ) { wxSize fontSizeInPixels; - wxScreenDC dc; + wxWindowDC dc( aWindow ); dc.SetFont( KIUI::GetControlFont( aWindow ) ); dc.GetTextExtent( wxT( "W" ), &fontSizeInPixels.x, &fontSizeInPixels.y );