Region& Region::Invert() { BeginOperation(); Region temp; temp.Include(Rect(-COORD_MAX, -COORD_MAX, COORD_MAX, COORD_MAX)); for (int i = 0; i < fNumRects; i++) temp.Exclude(fRects[i]); SetTo(temp); EndOperation(); return *this; }
Region& Region::Include(const Rect &rect) { Region temp; BeginOperation(); // Make sure that there are no overlaps temp.AddRect(rect); for (int i = 0; i < fNumRects; i++) temp.Exclude(RectAt(i)); AddRegionRects(temp); EndOperation(); return *this; }