Don't adjust the font to DPI if the window isn't created yet
This is at best useless, as we can't get the correct DPI to use before the window is created anyhow. See #22193.
This commit is contained in:
@@ -4891,7 +4891,13 @@ double wxWindowMSW::GetDPIScaleFactor() const
|
||||
|
||||
void wxWindowMSW::WXAdjustFontToOwnPPI(wxFont& font) const
|
||||
{
|
||||
font.WXAdjustToPPI(GetDPI());
|
||||
// We don't need to adjust the font if the window hasn't been created yet,
|
||||
// as our MSWUpdateFontOnDPIChange() will be called when it is created if a
|
||||
// non-default DPI is used and it will be done then, so skip doing it now,
|
||||
// especially because we can't get the correct DPI in GetDPI() anyhow
|
||||
// without a valid HWND.
|
||||
if ( GetHwnd() )
|
||||
font.WXAdjustToPPI(GetDPI());
|
||||
}
|
||||
|
||||
void wxWindowMSW::MSWUpdateFontOnDPIChange(const wxSize& newDPI)
|
||||
|
||||
Reference in New Issue
Block a user