mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +00:00
Ignore WindowManager invalidations inside already invalidated rects.
This commit is contained in:
parent
d6bbd2126d
commit
83252397e4
2 changed files with 15 additions and 2 deletions
|
@ -63,6 +63,14 @@ public:
|
|||
return contains(point.x(), point.y());
|
||||
}
|
||||
|
||||
bool contains(const Rect& other) const
|
||||
{
|
||||
return left() <= other.left()
|
||||
&& right() >= other.right()
|
||||
&& top() <= other.top()
|
||||
&& bottom() >= other.bottom();
|
||||
}
|
||||
|
||||
int left() const { return x(); }
|
||||
int right() const { return x() + width() - 1; }
|
||||
int top() const { return y(); }
|
||||
|
|
|
@ -339,8 +339,13 @@ void WindowManager::invalidate()
|
|||
|
||||
void WindowManager::invalidate(const Rect& rect)
|
||||
{
|
||||
if (!rect.is_empty())
|
||||
m_invalidated_rects.append(rect);
|
||||
if (rect.is_empty())
|
||||
return;
|
||||
for (auto& r : m_invalidated_rects) {
|
||||
if (r.contains(rect))
|
||||
return;
|
||||
}
|
||||
m_invalidated_rects.append(rect);
|
||||
}
|
||||
|
||||
void WindowManager::invalidate(const Window& window)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue