Only return really scaled bitmap size under platforms using DIPs

wxBitmap::GetScaledXXX() functions are useful for obtaining the
coordinates in logical pixels, so they should only divide by the scaling
factor on the platforms where logical pixels are actually different from
the physical ones, i.e. those using DPI-independent pixels.

This ensures that their behaviour under MSW remains unchanged even after
a1e4dca067 (Store scale factor in wxMSW bitmaps too, 2021-12-16), which
is the correct way to avoid breaking wxAUI (and other) drawing.
This commit is contained in:
Vadim Zeitlin
2022-01-06 18:54:39 +00:00
parent afe3d0ebae
commit f6fbc97c7b
5 changed files with 41 additions and 9 deletions

View File

@@ -1387,17 +1387,17 @@ double wxBitmap::GetScaleFactor() const
double wxBitmap::GetScaledWidth() const
{
return GetWidth() / GetScaleFactor();
return GetWidth();
}
double wxBitmap::GetScaledHeight() const
{
return GetHeight() / GetScaleFactor();
return GetHeight();
}
wxSize wxBitmap::GetScaledSize() const
{
return GetSize() / GetScaleFactor();
return GetSize();
}
// ----------------------------------------------------------------------------