]> git.saurik.com Git - wxWidgets.git/commitdiff
use appropriate casts to fix warnings about double=>int conversions
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 1 Feb 2009 13:45:17 +0000 (13:45 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 1 Feb 2009 13:45:17 +0000 (13:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gdicmn.h

index c7a9388fc37ba69605a97463bfff3090368b1046..74a39cfcd116fcb8be3b4a84c3fac58a394bf52a 100644 (file)
@@ -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));
 }