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:
parent
9a5d2ffade
commit
8ccbd7e95d
1 changed files with 6 additions and 0 deletions
|
|
@ -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; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue