Is there a wxRegion::Intersects() or some way of doing it?
-
- I live to help wx-kind
- Posts: 198
- Joined: Sat Oct 28, 2006 3:36 am
Is there a wxRegion::Intersects() or some way of doing it?
I need to know if a region intersects a rectangle. There doesn't seem to be an intersects() function in wxRegion. I can do wxRegion().GetBox() but a box isn't fine grained enough. Anyone know how to know if a wxRect intersects a wxRegion?
Re: Is there a wxRegion::Intersects() or some way of doing i
wxRegion::Intersect(wxRect&) appears to be there in in wxWidgets 2.8 and wxWidgets 2.9?
-
- I live to help wx-kind
- Posts: 198
- Joined: Sat Oct 28, 2006 3:36 am
Re: Is there a wxRegion::Intersects() or some way of doing i
That function creates a region that intersects both (or something). It doesn't actually tell you if region and rect intersect.PB wrote:wxRegion::Intersect(wxRect&) appears to be there in in wxWidgets 2.8 and wxWidgets 2.9?
Re: Is there a wxRegion::Intersects() or some way of doing i
And is that not enough to get the information required - something like the code below doesn't work?
Code: Select all
bool RegionsIntersect(const wxRegion& region, const wxRect& rect)
{
wxRegion r(region);
return r.Intersect(rect) && !r.IsEmpty();
}