From 902c2ef5a3767ee290bbc77b98d3ecfa2ab8ba18 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 1 Aug 2023 10:25:26 -0400 Subject: [PATCH] LibWeb: Add a clip rect for AudioPaintable Not a huge deal because the base MediaPaintable class goes very out of its way to paint within the confines of its own box, but just to be safe, this was missed when adding the AudioPaintable class. --- Userland/Libraries/LibWeb/Painting/AudioPaintable.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWeb/Painting/AudioPaintable.cpp b/Userland/Libraries/LibWeb/Painting/AudioPaintable.cpp index 82c9a7b897..d789061327 100644 --- a/Userland/Libraries/LibWeb/Painting/AudioPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/AudioPaintable.cpp @@ -52,7 +52,11 @@ void AudioPaintable::paint(PaintContext& context, PaintPhase phase) const if (phase != PaintPhase::Foreground) return; + Gfx::PainterStateSaver saver { context.painter() }; + auto audio_rect = context.rounded_device_rect(absolute_rect()); + context.painter().add_clip_rect(audio_rect.to_type()); + ScopedCornerRadiusClip corner_clip { context, context.painter(), audio_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) }; auto const& audio_element = layout_box().dom_node();