Skip to content

Commit 3c7c210

Browse files
committed
Fix Write() stroke width to scale with font_size or object scale
1 parent 115dc1c commit 3c7c210

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

manim/animation/creation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,8 @@ def _adjust_stroke_width_for_text(
388388
return stroke_width
389389
if not isinstance(vmobject, SVGMobject):
390390
return 2.0 # default in DrawBorderThenFill
391-
# font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
392-
# return (font_size / DEFAULT_FONT_SIZE) * DEFAULT_STROKE_WIDTH * scale_factor
393-
return 2
391+
font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
392+
return (font_size / DEFAULT_FONT_SIZE) * DEFAULT_STROKE_WIDTH * scale_factor
394393

395394
def reverse_submobjects(self) -> None:
396395
self.mobject.invert(recursive=True)

0 commit comments

Comments
 (0)