diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-16 13:58:02 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-16 13:58:02 +0200 |
commit | f61549ca5fdf8101535fbcaea3f830b372416303 (patch) | |
tree | 1eb3d4c5472397c43bb0010b013082e8f10fb9b7 /LibGUI | |
parent | 952f334de75285295cdc16ad683bff0eb9bdf8d9 (diff) | |
download | serenity-f61549ca5fdf8101535fbcaea3f830b372416303.zip |
Make better use of geometry class helpers in some places.
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GWidget.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
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); } } |