Add wxWindow::WXAdjustFontToOwnPPI()
Avoid calling GeTDPI() in font.WXAdjustToPPI(GetDPI()); invocations in common code on platforms that don't need any adjustment (i.e. anything other than MSW). This fixes wxOSX crashes when GetFont() is called too early during window creation, but is the right thing to do regardless. Closes https://github.com/wxWidgets/wxWidgets/pull/2036 Closes #18903.
This commit is contained in:
committed by
Vadim Zeitlin
parent
9e68df224f
commit
8efc6fb003
@@ -599,6 +599,8 @@ public:
|
||||
void MSWUpdateOnDPIChange(const wxSize& oldDPI, const wxSize& newDPI);
|
||||
|
||||
protected:
|
||||
virtual void WXAdjustFontToOwnPPI(wxFont& font) const wxOVERRIDE;
|
||||
|
||||
// Called from MSWUpdateOnDPIChange() specifically to update the control
|
||||
// font, as this may need to be done differently for some specific native
|
||||
// controls. The default version updates m_font of this window.
|
||||
|
Reference in New Issue
Block a user