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:
Aliaksandr Kalenik 2024-02-28 11:54:08 +01:00 committed by Tim Flynn
parent ae42c6ed80
commit 91378ded96
Notes: sideshowbarker 2024-07-17 08:42:05 +09:00

View File

@ -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