Add wxBitmap::GetLogical{Width,Height,Size}()

These functions have better names than the existing GetScaledXXX() ones,
so add them to be able to use them in the new code, even if we still
keep the old ones for compatibility.
This commit is contained in:
Vadim Zeitlin
2022-01-22 18:56:21 +00:00
parent 1ae0037330
commit 65bb454311
6 changed files with 96 additions and 51 deletions

View File

@@ -198,10 +198,16 @@ public:
// 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).
double GetScaledWidth() const;
double GetScaledHeight() const;
wxSize GetScaledSize() const;
// return the same thing as normal accessors elsewhere (e.g. MSW).
double GetLogicalWidth() const;
double GetLogicalHeight() const;
wxSize GetLogicalSize() const;
// Old synonyms for GetLogicalXXX() functions, prefer the new names in the
// new code.
double GetScaledWidth() const { return GetLogicalWidth(); }
double GetScaledHeight() const { return GetLogicalHeight(); }
wxSize GetScaledSize() const { return GetLogicalSize(); }
#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const = 0;