Add wxGetDPIofHDC() helper function and use it in wxMSW code

No real changes, just replace several pairs of calls to GetDeviceCaps()
with a single helper function call.
This commit is contained in:
Vadim Zeitlin
2022-03-19 22:16:18 +01:00
parent a3a1f8a2f1
commit f54ebf3261
7 changed files with 27 additions and 40 deletions

View File

@@ -4878,9 +4878,7 @@ wxSize wxWindowMSW::GetDPI() const
if ( !dpi.x || !dpi.y )
{
WindowHDC hdc(hwnd);
dpi.x = ::GetDeviceCaps(hdc, LOGPIXELSX);
dpi.y = ::GetDeviceCaps(hdc, LOGPIXELSY);
dpi = wxGetDPIofHDC(WindowHDC(hwnd));
}
return dpi;