Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 276826ba authored by Mathias Agopian's avatar Mathias Agopian
Browse files

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

parent 5fc1b60e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
+6 −0
Original line number Diff line number Diff line
@@ -87,6 +87,12 @@ Region& Region::operator = (const Region& rhs)
    return *this;
}

Region& Region::makeBoundsSelf()
{
    mStorage.clear();
    return *this;
}

void Region::clear()
{
    mBounds.clear();