mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user