summaryrefslogtreecommitdiff
path: root/LibGUI/GWindow.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-16 13:25:00 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-16 13:25:00 +0200
commit952f334de75285295cdc16ad683bff0eb9bdf8d9 (patch)
tree50845a209281978a34f9eddc629c01824c236acc /LibGUI/GWindow.cpp
parentc812d63ea6d56be3c1d80753535e4c861c150c5e (diff)
downloadserenity-952f334de75285295cdc16ad683bff0eb9bdf8d9.zip
GWidget: Tidy up the hit-testing code somewhat.
Diffstat (limited to 'LibGUI/GWindow.cpp')
-rw-r--r--LibGUI/GWindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/LibGUI/GWindow.cpp b/LibGUI/GWindow.cpp
index f002078987..5e294ffc25 100644
--- a/LibGUI/GWindow.cpp
+++ b/LibGUI/GWindow.cpp
@@ -191,8 +191,8 @@ void GWindow::event(CEvent& event)
if (!m_main_widget)
return;
if (m_main_widget) {
- auto result = m_main_widget->hit_test(mouse_event.x(), mouse_event.y());
- auto local_event = make<GMouseEvent>((GEvent::Type)event.type(), Point { result.localX, result.localY }, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers());
+ auto result = m_main_widget->hit_test(mouse_event.position());
+ auto local_event = make<GMouseEvent>((GEvent::Type)event.type(), result.local_position, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers());
ASSERT(result.widget);
set_hovered_widget(result.widget);
if (mouse_event.buttons() != 0 && !m_automatic_cursor_tracking_widget)