mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Be less lenient in scrollbar hit testing
A scrollbar contains a mouse position only if its gutter rect contains that position. We were incorrectly deciding a position was contained if it fell to the right of a vertical scrollbar, or below a horizontal scrollbar.
This commit is contained in:
parent
a8529629e2
commit
22532c769c
Notes:
github-actions[bot]
2025-05-08 09:42:05 +00:00
Author: https://github.com/trflynn89
Commit: 22532c769c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4640
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 1 additions and 3 deletions
|
@ -986,9 +986,7 @@ bool PaintableBox::scrollbar_contains_mouse_position(ScrollDirection direction,
|
|||
if (!scrollbar_data.has_value())
|
||||
return false;
|
||||
|
||||
if (direction == ScrollDirection::Horizontal)
|
||||
return position.y() >= scrollbar_data->thumb_rect.top();
|
||||
return position.x() >= scrollbar_data->thumb_rect.left();
|
||||
return scrollbar_data->gutter_rect.contains(position);
|
||||
}
|
||||
|
||||
void PaintableBox::scroll_to_mouse_postion(CSSPixelPoint position)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue