Skip to content

Commit 2147f8f

Browse files
committed
Fix Write() stroke width to scale with font_size or object scale
1 parent e7a498e commit 2147f8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

manim/animation/creation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def construct(self):
9494
from ..animation.animation import Animation
9595
from ..animation.composition import Succession
9696
from ..mobject.mobject import Group, Mobject
97-
from ..mobject.text.tex_mobject import SingleStringMathTex
97+
from ..mobject.svg.svg_mobject import SVGMobject
9898
from ..mobject.types.vectorized_mobject import VMobject
9999
from ..utils.bezier import integer_interpolate
100100
from ..utils.rate_functions import double_smooth, linear
@@ -386,9 +386,9 @@ def _adjust_stroke_width_for_text(
386386
) -> float:
387387
if stroke_width is not None:
388388
return stroke_width
389-
if not isinstance(vmobject, SingleStringMathTex):
390-
return 2 # default in DrawBorderThenFill
391-
font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
389+
if not isinstance(vmobject, SVGMobject):
390+
return 2.0 # default in DrawBorderThenFill
391+
font_size = DEFAULT_FONT_SIZE
392392
return (font_size / DEFAULT_FONT_SIZE) * DEFAULT_STROKE_WIDTH * scale_factor
393393

394394
def reverse_submobjects(self) -> None:

0 commit comments

Comments
 (0)