From ee08bdb5b6c1a10abc0d9319ba38c8e011e1ac2f Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 1 Feb 2009 13:45:17 +0000 Subject: [PATCH] use appropriate casts to fix warnings about double=>int conversions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gdicmn.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index c7a9388fc3..74a39cfcd1 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -240,8 +240,8 @@ public: wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } wxSize& operator/=(int i) { x /= i; y /= i; return *this; } wxSize& operator*=(int i) { x *= i; y *= i; return *this; } - wxSize& operator/=(double i) { x /= i; y /= i; return *this; } - wxSize& operator*=(double i) { x *= i; y *= i; return *this; } + wxSize& operator/=(double i) { x = int(x/i); y = int(y/i); return *this; } + wxSize& operator*=(double i) { x = int(x*i); y = int(y*i); return *this; } void IncTo(const wxSize& sz) { if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; } @@ -322,12 +322,12 @@ inline wxSize operator*(int i, const wxSize& s) inline wxSize operator*(const wxSize& s, double i) { - return wxSize(s.x * i, s.y * i); + return wxSize(int(s.x * i), int(s.y * i)); } inline wxSize operator*(double i, const wxSize& s) { - return wxSize(s.x * i, s.y * i); + return wxSize(int(s.x * i), int(s.y * i)); } -- 2.47.2