Add wxWindow::GetDPIScaleFactor()

This function replaces some uses of GetContentScaleFactor(), where a
factor greater than 1 must be used even under the platforms not doing
any logical/physical pixel mapping, such as MSW.

For now GetContentScaleFactor() is still unchanged, but it will return 1
for such platforms in the future and adding GetDPIScaleFactor() allows
to avoid changing the behaviour of the code which relied on its current
behaviour.
This commit is contained in:
Vadim Zeitlin
2020-07-18 22:27:28 +02:00
parent 0645ff25a7
commit 1422991602
8 changed files with 42 additions and 18 deletions

View File

@@ -111,7 +111,7 @@ float wxSizerFlags::DoGetDefaultBorderInPx()
if ( s_defaultBorderInPx.HasChanged(win) )
{
s_defaultBorderInPx.SetAtNewDPI(
(float)(5 * (win ? win->GetContentScaleFactor() : 1)));
(float)(5 * (win ? win->GetDPIScaleFactor() : 1.0)));
}
return s_defaultBorderInPx.Get();
}