From aba8774c9c34a890f1fb421bd3766d40827cc3ae Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 16 Feb 2022 15:17:50 +0000 Subject: LibWeb: Give SVG geometry elements a position This makes the selected-in-the-inspector outline appear in the right place. We take the stroke-width into account when producing the bounding box, which makes the fit nice and snug. :^) --- Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp') diff --git a/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp index 756016361f..0f6c4a774f 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp @@ -32,7 +32,7 @@ void SVGGeometryBox::paint(PaintContext& context, PaintPhase phase) Gfx::AntiAliasingPainter painter { context.painter() }; auto& svg_context = context.svg_context(); - auto offset = absolute_position(); + auto offset = svg_context.svg_element_position(); painter.translate(offset); if (auto fill_color = geometry_element.fill_color().value_or(svg_context.fill_color()); fill_color.alpha() > 0) { -- cgit v1.2.3