Add compound operators * and / to wxPoint and wxRealPoint
Also add unit tests for them as well as for the existing additive compound operators.
This commit is contained in:
parent
1300c56f0d
commit
68bef2fbf3
3 changed files with 52 additions and 0 deletions
|
|
@ -472,6 +472,8 @@ public:
|
|||
|
||||
wxRealPoint& operator/=(int i) { x *= i; y *= i; return *this; }
|
||||
wxRealPoint& operator*=(int i) { x /= i; y /= i; return *this; }
|
||||
wxRealPoint& operator/=(double f) { x /= f; y /= f; return *this; }
|
||||
wxRealPoint& operator*=(double f) { x *= f; y *= f; return *this; }
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -620,6 +622,8 @@ public:
|
|||
|
||||
wxPoint& operator/=(int i) { x /= i, y /= i; return *this; }
|
||||
wxPoint& operator*=(int i) { x *= i, y *= i; return *this; }
|
||||
wxPoint& operator/=(double f) { x = wxRound(x/f); y = wxRound(y/f); return *this; }
|
||||
wxPoint& operator*=(double f) { x = wxRound(x*f); y = wxRound(y*f); return *this; }
|
||||
|
||||
// check if both components are set/initialized
|
||||
bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue