Rename wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize()

The new name, recently introduced in 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22), was perhaps more clear,
but also misleading and confusing because the postcondition

	CreateWithLogicalSize(size, 2).GetLogicalSize() == size

was not satisfied under MSW, so rename it once again, and hopefully
finally, because the new name is consistent with GetDIPSize() returning
the same size.

Also try to improve the documentation a bit more.
This commit is contained in:
Vadim Zeitlin 2022-02-11 17:30:57 +00:00
parent 20f82e2ccb
commit 74424cbeb2
13 changed files with 53 additions and 48 deletions

View file

@ -178,13 +178,13 @@ public:
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
bool CreateWithLogicalSize(const wxSize& sz,
double scale,
int depth = wxBITMAP_SCREEN_DEPTH)
bool CreateWithDIPSize(const wxSize& sz,
double scale,
int depth = wxBITMAP_SCREEN_DEPTH)
{ return DoCreate(sz, scale, depth); }
bool CreateWithLogicalSize(int width, int height,
double scale,
int depth = wxBITMAP_SCREEN_DEPTH)
bool CreateWithDIPSize(int width, int height,
double scale,
int depth = wxBITMAP_SCREEN_DEPTH)
{ return DoCreate(wxSize(width, height), scale, depth); }
virtual int GetHeight() const = 0;
@ -211,10 +211,10 @@ public:
double GetLogicalHeight() const;
wxSize GetLogicalSize() const;
// Old synonyms for CreateWithLogicalSize() and GetLogicalXXX() functions,
// Old synonyms for CreateWithDIPSize() and GetLogicalXXX() functions,
// prefer the new names in the new code.
bool CreateScaled(int w, int h, int d, double logicalScale)
{ return CreateWithLogicalSize(w, h, logicalScale, d); }
{ return CreateWithDIPSize(w, h, logicalScale, d); }
double GetScaledWidth() const { return GetLogicalWidth(); }
double GetScaledHeight() const { return GetLogicalHeight(); }
wxSize GetScaledSize() const { return GetLogicalSize(); }