Add operator/(wxPoint, double) and operator/(wxRealPoint, double)
Do this for consistency with wxSize which already had this operator/() overload and operator*() in these classes which was already overloaded for double. Closes #24185. Closes #24187.
This commit is contained in:
parent
a5e9befd4d
commit
11ebffe7b0
2 changed files with 14 additions and 0 deletions
|
|
@ -564,6 +564,11 @@ inline wxRealPoint operator*(double i, const wxRealPoint& s)
|
|||
return wxRealPoint(s.x * i, s.y * i);
|
||||
}
|
||||
|
||||
inline wxRealPoint operator/(const wxRealPoint& p, double f)
|
||||
{
|
||||
return wxRealPoint(p.x / f, p.y / f);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPoint: 2D point with integer coordinates
|
||||
|
|
@ -719,6 +724,11 @@ inline wxPoint operator*(double i, const wxPoint& s)
|
|||
return wxPoint(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxPoint operator/(const wxPoint& p, double f)
|
||||
{
|
||||
return wxPoint(wxRound(p.x / f), wxRound(p.y / f));
|
||||
}
|
||||
|
||||
WX_DECLARE_LIST_WITH_DECL(wxPoint, wxPointList, class WXDLLIMPEXP_CORE);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -232,6 +232,8 @@ public:
|
|||
wxRealPoint operator *(int factor, const wxRealPoint& sz);
|
||||
wxRealPoint& operator /=(int factor);
|
||||
wxRealPoint& operator *=(int factor);
|
||||
|
||||
wxRealPoint operator /(const wxRealPoint& pt, double factor);
|
||||
///@}
|
||||
|
||||
/**
|
||||
|
|
@ -736,6 +738,8 @@ public:
|
|||
wxPoint operator *(int factor, const wxPoint& sz);
|
||||
wxPoint& operator /=(int factor);
|
||||
wxPoint& operator *=(int factor);
|
||||
|
||||
wxPoint operator /(const wxPoint& pt, double factor);
|
||||
///@}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue