LibWeb: Reset painter translation when painting fixed-position elements

This makes nested position:fixed elements work, previously we'd apply
the viewport scroll offset once at every nesting level.
This commit is contained in:
Andreas Kling 2022-10-01 14:04:22 +02:00
parent a494bd24f1
commit 95a3da86c3
Notes: sideshowbarker 2024-07-17 18:38:54 +09:00

View file

@ -299,7 +299,7 @@ void StackingContext::paint(PaintContext& context) const
{
Gfx::PainterStateSaver saver(context.painter());
if (m_box.is_fixed_position()) {
context.painter().translate(context.scroll_offset());
context.painter().translate(-context.painter().translation());
}
auto opacity = m_box.computed_values().opacity();