Round values in wxBitmap::CreateScaled() and GetScaledSize().

Do it for consistency with wxMSW and because rounding probably makes more
sense than truncation here.

Closes #15720.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-11-28 12:43:12 +00:00
parent 0cd24ec39a
commit 9180e2b06f

View File

@@ -175,7 +175,7 @@ public:
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0; 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; virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool CreateScaled(int w, int h, int d, double logicalScale) virtual bool CreateScaled(int w, int h, int d, double logicalScale)
{ return Create(w*logicalScale,h*logicalScale,d); } { return Create(wxRound(w*logicalScale), wxRound(h*logicalScale), d); }
virtual int GetHeight() const = 0; virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0; virtual int GetWidth() const = 0;
@@ -189,7 +189,7 @@ public:
virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); } virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); }
virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); } virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); }
virtual wxSize GetScaledSize() const virtual wxSize GetScaledSize() const
{ return wxSize(GetScaledWidth(), GetScaledHeight()); } { return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight())); }
#if wxUSE_IMAGE #if wxUSE_IMAGE
virtual wxImage ConvertToImage() const = 0; virtual wxImage ConvertToImage() const = 0;