mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
LibWeb: Apply scroll offset after clip in PaintableBox::before_paint()
The order is important because clip rectangles are calculated with the scroll offset taken into account. Therefore, they need to be applied before the scroll offset is changed, to avoid accounting for the scroll offset twice.
This commit is contained in:
parent
ae42c6ed80
commit
91378ded96
Notes:
sideshowbarker
2024-07-17 08:42:05 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/91378ded96 Pull-request: https://github.com/SerenityOS/serenity/pull/23384 Reviewed-by: https://github.com/AtkinsSJ ✅
@ -240,8 +240,8 @@ void PaintableBox::before_paint(PaintContext& context, [[maybe_unused]] PaintPha
|
||||
if (!is_visible())
|
||||
return;
|
||||
|
||||
apply_scroll_offset(context, phase);
|
||||
apply_clip_overflow_rect(context, phase);
|
||||
apply_scroll_offset(context, phase);
|
||||
}
|
||||
|
||||
void PaintableBox::after_paint(PaintContext& context, [[maybe_unused]] PaintPhase phase) const
|
||||
@ -249,8 +249,8 @@ void PaintableBox::after_paint(PaintContext& context, [[maybe_unused]] PaintPhas
|
||||
if (!is_visible())
|
||||
return;
|
||||
|
||||
clear_clip_overflow_rect(context, phase);
|
||||
reset_scroll_offset(context, phase);
|
||||
clear_clip_overflow_rect(context, phase);
|
||||
}
|
||||
|
||||
void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
|
||||
|
Loading…
Reference in New Issue
Block a user