Implement + and - between wxRealPoint and wxSize.
These operators are part of the documented interface for wxRealPoint but were never implemented. This commit implements them.
This commit is contained in:
parent
8ccbd7e95d
commit
66e7d0bce8
1 changed files with 19 additions and 1 deletions
|
|
@ -490,12 +490,30 @@ inline wxRealPoint operator+(const wxRealPoint& p1, const wxRealPoint& p2)
|
|||
return wxRealPoint(p1.x + p2.x, p1.y + p2.y);
|
||||
}
|
||||
|
||||
|
||||
inline wxRealPoint operator-(const wxRealPoint& p1, const wxRealPoint& p2)
|
||||
{
|
||||
return wxRealPoint(p1.x - p2.x, p1.y - p2.y);
|
||||
}
|
||||
|
||||
inline wxRealPoint operator+(const wxRealPoint& pt, const wxSize& sz)
|
||||
{
|
||||
return wxRealPoint(pt.x + sz.GetWidth(), pt.y + sz.GetHeight());
|
||||
}
|
||||
|
||||
inline wxRealPoint operator-(const wxRealPoint& pt, const wxSize& sz)
|
||||
{
|
||||
return wxRealPoint(pt.x - sz.GetWidth(), pt.y - sz.GetHeight());
|
||||
}
|
||||
|
||||
inline wxRealPoint operator+(const wxSize& sz, const wxRealPoint& pt)
|
||||
{
|
||||
return wxRealPoint(sz.GetWidth() + pt.x, sz.GetHeight() + pt.y);
|
||||
}
|
||||
|
||||
inline wxRealPoint operator-(const wxSize& sz, const wxRealPoint& pt)
|
||||
{
|
||||
return wxRealPoint(sz.GetWidth() - pt.x, sz.GetHeight() - pt.y);
|
||||
}
|
||||
|
||||
inline wxRealPoint operator/(const wxRealPoint& p, int i)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue