Move scale factor-related functions to wxGDIImage from wxBitmap

This makes them available in wxIcon (and, less importantly, wxCursor)
too which is needed in order to use icons correctly in high DPI.

This is also more consistent with the other platforms, where wxIcon does
have these methods.

Document these methods in wxIcon now that they're available there under
all platforms and also document wxIcon::GetSize() which had been
available even before, but wasn't documented.
This commit is contained in:
Vadim Zeitlin
2022-01-22 22:54:39 +00:00
parent c1d91d5566
commit b4946c2fe3
5 changed files with 101 additions and 62 deletions

View File

@@ -191,19 +191,6 @@ public:
void UseAlpha(bool use = true);
void ResetAlpha() { UseAlpha(false); }
// allow setting and storing the scale factor
virtual void SetScaleFactor(double scale);
virtual double GetScaleFactor() const;
// return the size divided by scale factor
wxSize GetDIPSize() const;
// logical metrics accessors return the same thing as physical ones, just
// as in all the other ports without wxHAS_DPI_INDEPENDENT_PIXELS.
double GetLogicalWidth() const;
double GetLogicalHeight() const;
wxSize GetLogicalSize() const;
// old synonyms for CreateWithLogicalSize() and GetLogicalXXX() functions
bool CreateScaled(int w, int h, int d, double logicalScale)
{ return CreateWithLogicalSize(wxSize(w, h), logicalScale, d); }