mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 20:42:21 +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
Notes:
sideshowbarker
2024-07-17 03:28:51 +09:00
Author: https://github.com/andreao
Commit: 9cab5059f8
Pull-request: https://github.com/SerenityOS/serenity/pull/16256
Reviewed-by: https://github.com/awesomekling
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()) };
|
||||
}
|
||||
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