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.
This commit is contained in:
Aliaksandr Kalenik 2024-08-12 19:04:45 +02:00 committed by Andreas Kling
commit c4ce797366
Notes: github-actions[bot] 2024-08-15 11:45:51 +00:00

View file

@ -33,7 +33,7 @@ void SVGSVGPaintable::before_children_paint(PaintContext& context, PaintPhase ph
return; return;
context.display_list_recorder().save(); context.display_list_recorder().save();
auto clip_rect = absolute_rect(); 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<int>()); context.display_list_recorder().add_clip_rect(context.enclosing_device_rect(clip_rect).to_type<int>());
} }