From 91378ded963f2b12643f4412950bf5461d1a5e9a Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 28 Feb 2024 11:54:08 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/Painting/PaintableBox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index c21dfeed946..a410c084764 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -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