From fc84bd0570d98bb8e7adbe4458ca5e8f1fd64e48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 24 Nov 2004 14:18:20 +0000 Subject: [PATCH] Expression simplifications for scaling and inflating. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gdicmn.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 7741ee467e..ff1c1a722b 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -217,9 +217,15 @@ public: bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; } bool operator!=(const wxSize& sz) const { return x != sz.x || y != sz.y; } - // FIXME are these really useful? If they're, we should have += &c as well wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); } wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); } + wxSize operator/(const int i) { return wxSize(x / i, y / i); } + wxSize operator*(const int i) { return wxSize(x * i, y * i); } + + wxSize& operator+=(const wxSize& sz) { x += sz.x; y += sz.y; return *this; } + wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } + wxSize& operator/=(const int i) { x /= i; y /= i; return *this; } + wxSize& operator*=(const int 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; } -- 2.45.2