mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +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());
|
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 left() const { return x(); }
|
||||||
int right() const { return x() + width() - 1; }
|
int right() const { return x() + width() - 1; }
|
||||||
int top() const { return y(); }
|
int top() const { return y(); }
|
||||||
|
|
|
@ -339,7 +339,12 @@ void WindowManager::invalidate()
|
||||||
|
|
||||||
void WindowManager::invalidate(const Rect& rect)
|
void WindowManager::invalidate(const Rect& rect)
|
||||||
{
|
{
|
||||||
if (!rect.is_empty())
|
if (rect.is_empty())
|
||||||
|
return;
|
||||||
|
for (auto& r : m_invalidated_rects) {
|
||||||
|
if (r.contains(rect))
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_invalidated_rects.append(rect);
|
m_invalidated_rects.append(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue