Add wxBitmap::GetDIPSize() and use it in wxBitmapBundleImplArt
This fixes the problem with wrong standard bitmaps size when using high DPI for the main monitor with wxMSW, as GetScaledSize() used here since 31f2892200 (Avoid bitmap scaling in wxArtProvider::GetBitmapBundle(), 2021-12-17) was not the right function to use there. Closes #19331.
This commit is contained in:
@@ -186,10 +186,16 @@ public:
|
||||
wxSize GetSize() const
|
||||
{ return wxSize(GetWidth(), GetHeight()); }
|
||||
|
||||
// support for scaled bitmaps
|
||||
// Store or return the scale factor, which determines the ratio between the
|
||||
// bitmap physical size and its DIP size (on all platforms). By default
|
||||
// it's just 1.
|
||||
virtual void SetScaleFactor(double scale);
|
||||
virtual double GetScaleFactor() const;
|
||||
|
||||
// This function returns the size divided by the scale factor, so that a
|
||||
// 64x64 bitmap with a scale factor of 2 has DIP size of 32x32 everywhere.
|
||||
wxSize GetDIPSize() const;
|
||||
|
||||
// These functions return the corresponding metrics divided by the scale
|
||||
// factor on platforms with DPI-independent pixels (e.g. GTK, Mac) and just
|
||||
// the same thing as the non-scaled accessors elsewhere (e.g. MSW).
|
||||
|
||||
@@ -188,6 +188,9 @@ public:
|
||||
virtual void SetScaleFactor(double scale);
|
||||
virtual double GetScaleFactor() const;
|
||||
|
||||
// return the size divided by scale factor
|
||||
wxSize GetDIPSize() const;
|
||||
|
||||
// but scaled metrics accessors return the same thing as non-scaled ones,
|
||||
// just as in all the other ports without wxHAS_DPI_INDEPENDENT_PIXELS.
|
||||
double GetScaledWidth() const;
|
||||
|
||||
Reference in New Issue
Block a user