소스 검색

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.
Andreas Kling 2 년 전
부모
커밋
95a3da86c3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibWeb/Painting/StackingContext.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Painting/StackingContext.cpp

@@ -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();