Browse Source

LibWeb: Make VideoPaintable's clip rect temporary

Otherwise, in a simple page such as:

    <video src=...>
    <audio src=...>

The video's clip rect would "leak" to the AudioPaintable, preventing the
audio controls from rendering at all.
Timothy Flynn 1 year ago
parent
commit
44911173f5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Userland/Libraries/LibWeb/Painting/VideoPaintable.cpp

+ 2 - 0
Userland/Libraries/LibWeb/Painting/VideoPaintable.cpp

@@ -61,6 +61,8 @@ void VideoPaintable::paint(PaintContext& context, PaintPhase phase) const
     if (phase != PaintPhase::Foreground)
         return;
 
+    Gfx::PainterStateSaver saver { context.painter() };
+
     auto video_rect = context.rounded_device_rect(absolute_rect());
     context.painter().add_clip_rect(video_rect.to_type<int>());