mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Specialize hit testing for text cursor purposes
The text cursor follows slightly different "intuitive" rules than the regular hit testing. Clicking past the right edge of a text box should still "hit" the text box, and place the cursor at its end, for example. We solve this by adding a HitTestType enum that is passed to hit_test() and determines whether past-the-edge candidates are considered.
This commit is contained in:
@@ -113,9 +113,9 @@ void LayoutDocument::paint(PaintContext& context, PaintPhase phase)
|
||||
stacking_context()->paint(context, phase);
|
||||
}
|
||||
|
||||
HitTestResult LayoutDocument::hit_test(const Gfx::IntPoint& position) const
|
||||
HitTestResult LayoutDocument::hit_test(const Gfx::IntPoint& position, HitTestType type) const
|
||||
{
|
||||
return stacking_context()->hit_test(position);
|
||||
return stacking_context()->hit_test(position, type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user