mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb: Use absolute padding box to calculate max scroll offset
In `PaintableBox::set_scroll_offset()` the scrollport size was measured by `content_size()` instead of `absolute_padding_box_rect()`. Fixes #788
This commit is contained in:
parent
1d03944a9c
commit
54066ec5a4
Notes:
github-actions[bot]
2024-07-23 16:00:12 +00:00
Author: https://github.com/simonkrauter
Commit: 54066ec5a4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/789
Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 3 additions and 2 deletions
|
@ -84,8 +84,9 @@ void PaintableBox::set_scroll_offset(CSSPixelPoint offset)
|
|||
document().set_needs_to_refresh_clip_state(true);
|
||||
document().set_needs_to_refresh_scroll_state(true);
|
||||
|
||||
auto max_x_offset = max(scrollable_overflow_rect->width() - content_size().width(), 0);
|
||||
auto max_y_offset = max(scrollable_overflow_rect->height() - content_size().height(), 0);
|
||||
auto padding_rect = absolute_padding_box_rect();
|
||||
auto max_x_offset = max(scrollable_overflow_rect->width() - padding_rect.width(), 0);
|
||||
auto max_y_offset = max(scrollable_overflow_rect->height() - padding_rect.height(), 0);
|
||||
|
||||
offset.set_x(clamp(offset.x(), 0, max_x_offset));
|
||||
offset.set_y(clamp(offset.y(), 0, max_y_offset));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue