mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:08:10 +00:00
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. :^)
This commit is contained in:
parent
a181cae3e0
commit
786494b62d
1 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ void HtmlView::mousemove_event(GMouseEvent& event)
|
||||||
return GScrollableWidget::mousemove_event(event);
|
return GScrollableWidget::mousemove_event(event);
|
||||||
|
|
||||||
bool hovered_node_changed = false;
|
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) {
|
if (result.layout_node) {
|
||||||
auto* node = result.layout_node->node();
|
auto* node = result.layout_node->node();
|
||||||
hovered_node_changed = node != m_document->hovered_node();
|
hovered_node_changed = node != m_document->hovered_node();
|
||||||
|
@ -121,7 +121,7 @@ void HtmlView::mousedown_event(GMouseEvent& event)
|
||||||
return GScrollableWidget::mousemove_event(event);
|
return GScrollableWidget::mousemove_event(event);
|
||||||
|
|
||||||
bool hovered_node_changed = false;
|
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) {
|
if (result.layout_node) {
|
||||||
auto* node = result.layout_node->node();
|
auto* node = result.layout_node->node();
|
||||||
hovered_node_changed = node != m_document->hovered_node();
|
hovered_node_changed = node != m_document->hovered_node();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue