Make wxWindow::GetContentScaleFactor() return 1 under MSW again

This reverts bc492a9e6e (Make wxWindow::GetContentScaleFactor() useful
for non-OSX platforms., 2015-03-18) and restores the old behaviour from
wxWidgets 3.0, which consisted in only returning factor different from 1
from this function for the platforms distinguishing logical and physical
pixels.

After this change, the return value of this function can be portably
used on all platforms to convert between logical and physical pixels,
independently of the current DPI.
This commit is contained in:
Vadim Zeitlin
2020-07-18 23:44:58 +02:00
parent 1422991602
commit cd8b2d3096
5 changed files with 39 additions and 16 deletions

View File

@@ -529,8 +529,10 @@ public:
return wxSize( wxMax( client.x, best.x ), wxMax( client.y, best.y ) );
}
// returns the magnification of the content of this window
// e.g. 2.0 for a window on a retina screen
// Return the magnification of the content of this window for the platforms
// using logical pixels different from physical ones, i.e. those for which
// wxHAVE_DPI_INDEPENDENT_PIXELS is defined. For the other ones, always
// returns 1, regardless of DPI scale factor returned by the function below.
virtual double GetContentScaleFactor() const;
// Return the ratio of the DPI used by this window to the standard DPI,