From c4ce79736654acf2da47db5dcd410a17e87a87c8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 12 Aug 2024 19:04:45 +0200 Subject: [PATCH] LibWeb: Use scroll frame id in SVGSVGPaintable::before_children_paint() A display list should not contain coordinates shifted by scroll offset. Instead, "scroll frame id" needs to be used. In the future it's going to allow us reuse a display list in cases when only scroll offsets need to be updated. --- Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp index 26b4241ccb4..1e353bd9f7c 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp @@ -33,7 +33,7 @@ void SVGSVGPaintable::before_children_paint(PaintContext& context, PaintPhase ph return; context.display_list_recorder().save(); auto clip_rect = absolute_rect(); - clip_rect.translate_by(enclosing_scroll_frame_offset()); + context.display_list_recorder().set_scroll_frame_id(scroll_frame_id()); context.display_list_recorder().add_clip_rect(context.enclosing_device_rect(clip_rect).to_type()); }