From: Francesco Montorsi Date: Sat, 31 Jan 2009 21:22:37 +0000 (+0000) Subject: add operator* taking doubles to wxSize X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9174364320602d6ec18a01935005013984bb59a4 add operator* taking doubles to wxSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 20e613dbd3..c7a9388fc3 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -240,6 +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; } void IncTo(const wxSize& sz) { if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; } @@ -283,7 +285,6 @@ public: int GetY() const { return y; } }; - inline bool operator==(const wxSize& s1, const wxSize& s2) { return s1.x == s2.x && s1.y == s2.y; @@ -294,36 +295,40 @@ inline bool operator!=(const wxSize& s1, const wxSize& s2) return s1.x != s2.x || s1.y != s2.y; } - inline wxSize operator+(const wxSize& s1, const wxSize& s2) { return wxSize(s1.x + s2.x, s1.y + s2.y); } - inline wxSize operator-(const wxSize& s1, const wxSize& s2) { return wxSize(s1.x - s2.x, s1.y - s2.y); } - inline wxSize operator/(const wxSize& s, int i) { return wxSize(s.x / i, s.y / i); } - inline wxSize operator*(const wxSize& s, int i) { return wxSize(s.x * i, s.y * i); } - inline wxSize operator*(int i, const wxSize& s) { return wxSize(s.x * i, s.y * i); } +inline wxSize operator*(const wxSize& s, double i) +{ + return wxSize(s.x * i, s.y * i); +} + +inline wxSize operator*(double i, const wxSize& s) +{ + return wxSize(s.x * i, s.y * i); +}