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 );