Region::makeBoundsSelf() efficiently turns a region to its bounds

This commit is contained in:
Mathias Agopian
2009-06-29 18:46:37 -07:00
parent 5fc1b60e7f
commit 276826bae2
2 changed files with 9 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ public:
inline Rect getBounds() const { return mBounds; }
inline Rect bounds() const { return getBounds(); }
// the region becomes its bounds
Region& makeBoundsSelf();
void clear();
void set(const Rect& r);
void set(uint32_t w, uint32_t h);

View File

@@ -87,6 +87,12 @@ Region& Region::operator = (const Region& rhs)
return *this;
}
Region& Region::makeBoundsSelf()
{
mStorage.clear();
return *this;
}
void Region::clear()
{
mBounds.clear();