added wxRect::Inside(wxRect) for testing if a rectangle is completely within another rectangle
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -243,6 +243,10 @@ means:
|
|||||||
Returns {\tt true} if the given point is inside the rectangle (or on its
|
Returns {\tt true} if the given point is inside the rectangle (or on its
|
||||||
boundary) and {\tt false} otherwise.
|
boundary) and {\tt false} otherwise.
|
||||||
|
|
||||||
|
\constfunc{bool}{Inside}{\param{const wxRect\& }{rect}}
|
||||||
|
|
||||||
|
Returns \true if the given rectangle is completely inside this rectangle
|
||||||
|
(or touches its boundary) and \false otherwise.
|
||||||
|
|
||||||
\membersection{wxRect::Intersects}\label{wxrectintersects}
|
\membersection{wxRect::Intersects}\label{wxrectintersects}
|
||||||
|
|
||||||
|
@@ -417,6 +417,8 @@ public:
|
|||||||
// return true if the point is (not strcitly) inside the rect
|
// return true if the point is (not strcitly) inside the rect
|
||||||
bool Inside(int x, int y) const;
|
bool Inside(int x, int y) const;
|
||||||
bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
|
bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
|
||||||
|
// return true if the rectangle is (not strcitly) inside the rect
|
||||||
|
bool Inside(const wxRect& rect) const;
|
||||||
|
|
||||||
// return true if the rectangles have a non empty intersection
|
// return true if the rectangles have a non empty intersection
|
||||||
bool Intersects(const wxRect& rect) const;
|
bool Intersects(const wxRect& rect) const;
|
||||||
|
@@ -186,6 +186,11 @@ bool wxRect::Inside(int cx, int cy) const
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxRect::Inside(const wxRect& rect) const
|
||||||
|
{
|
||||||
|
return Inside(rect.GetTopLeft()) && Inside(rect.GetBottomRight());
|
||||||
|
}
|
||||||
|
|
||||||
wxRect& wxRect::Intersect(const wxRect& rect)
|
wxRect& wxRect::Intersect(const wxRect& rect)
|
||||||
{
|
{
|
||||||
int x2 = GetRight(),
|
int x2 = GetRight(),
|
||||||
|
Reference in New Issue
Block a user