Implement operator/=(int) and operator*=(int) for wxPoint and wxRealPoint.

These operators are part of the documented interface but were never
implemented.  This commit implements them.
This commit is contained in:
David Miguel Susano Pinto 2024-01-04 01:16:48 +00:00
parent 9a5d2ffade
commit 8ccbd7e95d

View file

@ -469,6 +469,9 @@ public:
wxRealPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } wxRealPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; }
wxRealPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } wxRealPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; }
wxRealPoint& operator/=(int i) { x *= i; y *= i; return *this; }
wxRealPoint& operator*=(int i) { x /= i; y /= i; return *this; }
}; };
@ -592,6 +595,9 @@ public:
wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; }
wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; }
wxPoint& operator/=(int i) { x /= i, y /= i; return *this; }
wxPoint& operator*=(int i) { x *= i, y *= i; return *this; }
// check if both components are set/initialized // check if both components are set/initialized
bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; } bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; }