making GetDPIScaleFactor virtual, adding macOS direct impl

This commit is contained in:
Stefan Csomor
2020-08-08 18:43:55 +02:00
committed by Vadim Zeitlin
parent 8bad3b5e80
commit 7dc67a1f9f
3 changed files with 10 additions and 2 deletions

View File

@@ -2629,6 +2629,12 @@ wxSize wxWindowMac::OSXMakeDPIFromScaleFactor(double scaleFactor)
}
wxSize wxWindowMac::GetDPI() const
{
return OSXMakeDPIFromScaleFactor(GetDPIScaleFactor());
}
// on mac ContentScale and DPIScale are identical
double wxWindowMac::GetDPIScaleFactor() const
{
double scaleFactor;
if ( wxNonOwnedWindow* tlw = MacGetTopLevelWindow() )
@@ -2636,9 +2642,10 @@ wxSize wxWindowMac::GetDPI() const
else
scaleFactor = wxOSXGetMainScreenContentScaleFactor();
return OSXMakeDPIFromScaleFactor(scaleFactor);
return scaleFactor;
}
//
// wxWidgetImpl
//