mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
WindowManager::invalidate() can just use Rect::intersection().
This commit is contained in:
parent
84ae4e5880
commit
e5fc2ca900
1 changed files with 1 additions and 11 deletions
|
@ -320,17 +320,7 @@ void WindowManager::invalidate()
|
||||||
|
|
||||||
void WindowManager::invalidate(const Rect& a_rect)
|
void WindowManager::invalidate(const Rect& a_rect)
|
||||||
{
|
{
|
||||||
// FIXME: This code is fugly.
|
auto rect = Rect::intersection(a_rect, AbstractScreen::the().rect());
|
||||||
Rect rect(a_rect);
|
|
||||||
auto screen_rect = AbstractScreen::the().rect();
|
|
||||||
if (rect.left() < 0)
|
|
||||||
rect.set_left(0);
|
|
||||||
if (rect.top() < 0)
|
|
||||||
rect.set_top(0);
|
|
||||||
if (rect.right() > screen_rect.right())
|
|
||||||
rect.set_right(screen_rect.right());
|
|
||||||
if (rect.bottom() > screen_rect.bottom())
|
|
||||||
rect.set_bottom(screen_rect.bottom());
|
|
||||||
if (rect.is_empty())
|
if (rect.is_empty())
|
||||||
return;
|
return;
|
||||||
for (auto& r : m_invalidated_rects) {
|
for (auto& r : m_invalidated_rects) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue