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

LibWeb: Move scroll_offset() from Layout::Box to PaintableBox

Nodes in layout tree should not be aware of scroll state.
This commit is contained in:
Aliaksandr Kalenik 2023-08-06 20:51:46 +02:00 committed by Andreas Kling
parent 23a07a8ab6
commit 5b7926fa53
6 changed files with 23 additions and 26 deletions

View file

@ -29,7 +29,7 @@ static void paint_node(Layout::Node const& layout_node, PaintContext& context, P
if (auto const* paintable = layout_node.paintable()) {
if (paintable->containing_block() && paintable->containing_block()->is_scrollable()) {
Gfx::PainterStateSaver saver(context.painter());
auto scroll_offset = -paintable->containing_block()->scroll_offset();
auto scroll_offset = -paintable->containing_block()->paintable_box()->scroll_offset();
context.painter().translate({ context.enclosing_device_pixels(scroll_offset.x()), context.enclosing_device_pixels(scroll_offset.y()) });
paintable->paint(context, phase);
} else {