From f61549ca5fdf8101535fbcaea3f830b372416303 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 16 Apr 2019 13:58:02 +0200 Subject: Make better use of geometry class helpers in some places. --- LibGUI/GWidget.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'LibGUI') diff --git a/LibGUI/GWidget.cpp b/LibGUI/GWidget.cpp index 289a8fe1a6..76f94d8085 100644 --- a/LibGUI/GWidget.cpp +++ b/LibGUI/GWidget.cpp @@ -108,10 +108,7 @@ void GWidget::handle_paint_event(GPaintEvent& event) if (!child->is_visible()) continue; if (child->relative_rect().intersects(event.rect())) { - auto local_rect = event.rect(); - local_rect.intersect(child->relative_rect()); - local_rect.move_by(-child->relative_rect().x(), -child->relative_rect().y()); - GPaintEvent local_event(local_rect); + GPaintEvent local_event(event.rect().intersected(child->relative_rect()).translated(-child->relative_position())); child->event(local_event); } } -- cgit v1.2.3