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

@@ -12687,11 +12687,8 @@ bool wxRichTextImage::LoadAndScaleImageCache(wxImage& image, const wxSize& sz, w
else
{
double scaleFactor = 1.0;
// Scaled bitmaps only work on Mac currently
#ifdef __WXOSX_COCOA__
if (context.GetBuffer() && context.GetBuffer()->GetRichTextCtrl())
scaleFactor = context.GetBuffer()->GetRichTextCtrl()->GetContentScaleFactor();
#endif
// If the original width and height is small, e.g. 400 or below,
// scale up and then down to improve image quality. This can make