1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

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. :^)
This commit is contained in:
Sam Atkins 2022-02-16 15:17:50 +00:00 committed by Andreas Kling
parent ae93aeb414
commit aba8774c9c
4 changed files with 16 additions and 4 deletions

View file

@ -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) {