diff options
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/Widget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 807bc1cbad..65dfdd4de7 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -553,6 +553,10 @@ void Widget::update(const Gfx::IntRect& rect) if (!updates_enabled()) return; + auto bound_by_widget = rect.intersected(this->rect()); + if (bound_by_widget.is_empty()) + return; + Window* window = m_window; Widget* parent = parent_widget(); while (parent) { @@ -562,7 +566,7 @@ void Widget::update(const Gfx::IntRect& rect) parent = parent->parent_widget(); } if (window) - window->update(rect.translated(window_relative_rect().location())); + window->update(bound_by_widget.translated(window_relative_rect().location())); } Gfx::IntRect Widget::window_relative_rect() const |