mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
WindowManager::invalidate() can just use Rect::intersection().
This commit is contained in:
parent
84ae4e5880
commit
e5fc2ca900
Notes:
sideshowbarker
2024-07-19 16:04:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e5fc2ca9008
1 changed files with 1 additions and 11 deletions
|
@ -320,17 +320,7 @@ void WindowManager::invalidate()
|
|||
|
||||
void WindowManager::invalidate(const Rect& a_rect)
|
||||
{
|
||||
// FIXME: This code is fugly.
|
||||
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());
|
||||
auto rect = Rect::intersection(a_rect, AbstractScreen::the().rect());
|
||||
if (rect.is_empty())
|
||||
return;
|
||||
for (auto& r : m_invalidated_rects) {
|
||||
|
|
Loading…
Add table
Reference in a new issue