summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-03 09:17:27 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-03 09:17:27 +0200
commit786494b62dd6f369e6758f33ac4414403b8e833c (patch)
treec123fd85d9455d46e0ff029977c351d6aee683d1 /Libraries
parenta181cae3e015edbc9ddbdfb79edc14f884863ad4 (diff)
downloadserenity-786494b62dd6f369e6758f33ac4414403b8e833c.zip
LibHTML: Adjust mouse event positions before using them for hit testing
This fixes the issue where you couldn't click on links at the bottom of scrollable documents. :^)
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibHTML/HtmlView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibHTML/HtmlView.cpp b/Libraries/LibHTML/HtmlView.cpp
index 1f5c96bdc6..b3d277602b 100644
--- a/Libraries/LibHTML/HtmlView.cpp
+++ b/Libraries/LibHTML/HtmlView.cpp
@@ -88,7 +88,7 @@ void HtmlView::mousemove_event(GMouseEvent& event)
return GScrollableWidget::mousemove_event(event);
bool hovered_node_changed = false;
- auto result = m_layout_root->hit_test(event.position());
+ auto result = m_layout_root->hit_test(to_content_position(event.position()));
if (result.layout_node) {
auto* node = result.layout_node->node();
hovered_node_changed = node != m_document->hovered_node();
@@ -121,7 +121,7 @@ void HtmlView::mousedown_event(GMouseEvent& event)
return GScrollableWidget::mousemove_event(event);
bool hovered_node_changed = false;
- auto result = m_layout_root->hit_test(event.position());
+ auto result = m_layout_root->hit_test(to_content_position(event.position()));
if (result.layout_node) {
auto* node = result.layout_node->node();
hovered_node_changed = node != m_document->hovered_node();