From 3b7e51bc69668e983de52c2e026a2c7a64d76c1a Mon Sep 17 00:00:00 2001 From: Eymeric Chauchat <73040902+Eymeric65@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:29:25 +0900 Subject: [PATCH 1/2] Set default stroke width for SVG shapes without it Following SVG standard, when a stroke color is supplied without a line stroke, a line stroke is applied by default. This copy the behavior to manim --- manim/mobject/svg/svg_mobject.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.py index bd494c0211..44dbbcb3cb 100644 --- a/manim/mobject/svg/svg_mobject.py +++ b/manim/mobject/svg/svg_mobject.py @@ -327,6 +327,9 @@ def apply_style_to_mobject(mob: VMobject, shape: se.GraphicObject) -> VMobject: shape The parsed SVG element. """ + if shape.stroke.hexrgb is not None and (shape.stroke_width is None or shape.stroke_width == 0.0): + shape.stroke_width = 1.0 + mob.set_style( stroke_width=shape.stroke_width, stroke_color=shape.stroke.hexrgb, From 419ac1722866ee0e55e1367f46f4081e377b7316 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:33:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/mobject/svg/svg_mobject.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.py index 44dbbcb3cb..da37486ce4 100644 --- a/manim/mobject/svg/svg_mobject.py +++ b/manim/mobject/svg/svg_mobject.py @@ -327,9 +327,11 @@ def apply_style_to_mobject(mob: VMobject, shape: se.GraphicObject) -> VMobject: shape The parsed SVG element. """ - if shape.stroke.hexrgb is not None and (shape.stroke_width is None or shape.stroke_width == 0.0): + if shape.stroke.hexrgb is not None and ( + shape.stroke_width is None or shape.stroke_width == 0.0 + ): shape.stroke_width = 1.0 - + mob.set_style( stroke_width=shape.stroke_width, stroke_color=shape.stroke.hexrgb,