Do not scale the size of bitmap in wxMSW Create(size, dc) overload

The size passed to Create() should be interpreted in the same way as the
size passed to CreateWithLogicalSize() and in wxMSW this means that it
should _not_ be scaled.

This makes the size of the bitmap returned by this function overload
consistent with wxDC::GetSize(), so it looks like the right thing to do,
even if it's a backwards-incompatible change.

Closes #24559.
This commit is contained in:
Vadim Zeitlin
2024-06-09 12:23:03 +02:00
parent c7c6485c59
commit 7f5ca30e3e
3 changed files with 10 additions and 4 deletions
+4
View File
@@ -1839,7 +1839,11 @@ TEST_CASE("Bitmap::ScaleFactor", "[bitmap][dc][scale]")
// A bitmap "compatible" with this DC should also use the same scale factor.
wxBitmap bmp2(4, 4, dc);
CHECK( bmp2.GetScaleFactor() == 2 );
#ifdef wxHAS_DPI_INDEPENDENT_PIXELS
CHECK( bmp2.GetSize() == wxSize(8, 8) );
#else
CHECK( bmp2.GetSize() == wxSize(4, 4) );
#endif
// A compatible bitmap created from wxImage and this DC should also inherit
// the same scale factor, but its size should be still the same as that of