From 9180e2b06ff53a60b94b8f6f06f5c6988e09df08 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 28 Nov 2013 12:43:12 +0000 Subject: [PATCH] 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 --- include/wx/bitmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 6d9ffe71b7..cc602f71fb 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -175,7 +175,7 @@ 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; 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 GetWidth() const = 0; @@ -189,7 +189,7 @@ public: virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); } virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); } virtual wxSize GetScaledSize() const - { return wxSize(GetScaledWidth(), GetScaledHeight()); } + { return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight())); } #if wxUSE_IMAGE virtual wxImage ConvertToImage() const = 0;