Region::makeBoundsSelf() efficiently turns a region to its bounds
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -87,6 +87,12 @@ Region& Region::operator = (const Region& rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
Region& Region::makeBoundsSelf()
|
||||
{
|
||||
mStorage.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Region::clear()
|
||||
{
|
||||
mBounds.clear();
|
||||
|
||||
Reference in New Issue
Block a user