1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

LibWeb: Apply scroll offset to PushStackingContext command

In cases where the stacking context painting requires a separate
bitmap, the destination position needs to be translated by the
scrolling offset to ensure it ends up in the correct position.
This commit is contained in:
Aliaksandr Kalenik 2024-02-01 12:31:31 +01:00 committed by Andreas Kling
parent 384c6cf0f9
commit 5484062095
5 changed files with 150 additions and 1 deletions

View file

@ -319,9 +319,13 @@ void StackingContext::paint(PaintContext& context) const
}
}
context.recording_painter().save();
if (paintable().is_paintable_box() && paintable_box().scroll_frame_id().has_value())
context.recording_painter().set_scroll_frame_id(*paintable_box().scroll_frame_id());
context.recording_painter().push_stacking_context(push_stacking_context_params);
paint_internal(context);
context.recording_painter().pop_stacking_context();
context.recording_painter().restore();
}
template<typename Callback>