mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
LibWeb: Use correct end-of-fragment node index for HitTestResult
The indexes are into the _node_, not in the fragment, so when a node is split into multiple fragments, simply taking the length of the fragment is incorrect. This patch corrects this mistake.
This commit is contained in:
parent
31f4ec66c5
commit
9cab5059f8
1 changed files with 1 additions and 1 deletions
|
@ -700,7 +700,7 @@ Optional<HitTestResult> PaintableWithLines::hit_test(CSSPixelPoint position, Hit
|
||||||
return HitTestResult { *fragment.layout_node().paintable(), fragment.text_index_at(position.x().value()) };
|
return HitTestResult { *fragment.layout_node().paintable(), fragment.text_index_at(position.x().value()) };
|
||||||
}
|
}
|
||||||
if (fragment_absolute_rect.top() <= position.y())
|
if (fragment_absolute_rect.top() <= position.y())
|
||||||
last_good_candidate = HitTestResult { *fragment.layout_node().paintable(), fragment.length() + 1 };
|
last_good_candidate = HitTestResult { *fragment.layout_node().paintable(), fragment.start() + fragment.length() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue