mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb: Move adjustmust of scrollbar offset into compute_scrollbar_data
Currently, compute_scrollbar_data does not adjust the position of the scrollbar thumb based on the actual scroll offset. This is because we perform this offset in most cases inside the display list executor, in order to allow us to avoid recomputing the display list. However, there are cases where we do want the thumb rect with an offset inside PaintableBox. We currently use scroll_thumb_rect to perform that computation. In an upcoming patch, we will need both this offset thumb rect and the scrollbar gutter rect. So this patch moves the computation of the offset to compute_scrollbar_data, performed behind an optional parameter.
This commit is contained in:
parent
66e422b4f1
commit
a135ce528e
Notes:
github-actions[bot]
2025-04-22 15:30:08 +00:00
Author: https://github.com/trflynn89
Commit: a135ce528e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4417
2 changed files with 24 additions and 27 deletions
|
@ -266,8 +266,11 @@ protected:
|
|||
Horizontal,
|
||||
Vertical,
|
||||
};
|
||||
Optional<ScrollbarData> compute_scrollbar_data(ScrollDirection) const;
|
||||
[[nodiscard]] Optional<CSSPixelRect> scroll_thumb_rect(ScrollDirection) const;
|
||||
enum class AdjustThumbRectForScrollOffset {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
Optional<ScrollbarData> compute_scrollbar_data(ScrollDirection, AdjustThumbRectForScrollOffset = AdjustThumbRectForScrollOffset::No) const;
|
||||
[[nodiscard]] bool could_be_scrolled_by_wheel_event(ScrollDirection) const;
|
||||
|
||||
TraversalDecision hit_test_scrollbars(CSSPixelPoint position, Function<TraversalDecision(HitTestResult)> const& callback) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue