From 758d816b23e86cbe9f24471988e73f3c15f8c080 Mon Sep 17 00:00:00 2001 From: K-Adam Date: Sun, 1 Aug 2021 16:30:18 +0200 Subject: [PATCH] LibWeb: Clear SVG context after SVGSVGBox children are painted --- Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp | 1 + Userland/Libraries/LibWeb/Painting/PaintContext.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp index bbbd9a6137..f53bbbbebe 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp @@ -37,6 +37,7 @@ void SVGSVGBox::after_children_paint(PaintContext& context, PaintPhase phase) SVGGraphicsBox::after_children_paint(context, phase); if (phase != PaintPhase::Foreground) return; + context.clear_svg_context(); } } diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h index 6ae814994d..682601c158 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.h +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h @@ -29,6 +29,7 @@ public: bool has_svg_context() const { return m_svg_context.has_value(); } SVGContext& svg_context() { return m_svg_context.value(); } void set_svg_context(SVGContext context) { m_svg_context = context; } + void clear_svg_context() { m_svg_context.clear(); } bool should_show_line_box_borders() const { return m_should_show_line_box_borders; } void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }