Region Video::ClippedDrawingRect(const Region& target, const Region* clip) const { Region r = target.Intersect(screenClip); if (clip) { // Intersect clip with both screen and target rectangle r = clip->Intersect(r); } // the clip must be "safe". no negative values or crashy crashy if (r.Dimensions().IsEmpty()) { // logically equivalent to no intersection r.h = 0; r.w = 0; } return r; }
bool Robot::intersects( const Region& aRegion) const { Region region = getRegion(); region.Intersect( aRegion); return !region.IsEmpty(); }