Skip to content

Commit 783e210

Browse files
committed
Fix Write() stroke width to scale with font_size or object scale
1 parent 2457706 commit 783e210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manim/animation/creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def construct(self):
8585
from manim.mobject.text.text_mobject import Text
8686
from manim.scene.scene import Scene
8787

88-
from manim.constants import DEFAULT_FONT_SIZE, RIGHT, TAU
88+
from manim.constants import DEFAULT_FONT_SIZE, DEFAULT_STROKE_WIDTH, RIGHT, TAU
8989
from manim.mobject.opengl.opengl_surface import OpenGLSurface
9090
from manim.mobject.opengl.opengl_vectorized_mobject import OpenGLVMobject
9191
from manim.utils.color import ManimColor
@@ -389,7 +389,7 @@ def _adjust_stroke_width_for_text(
389389
if not isinstance(vmobject, SVGMobject):
390390
return 2.0 # default in DrawBorderThenFill
391391
font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
392-
return 2
392+
return (font_size / DEFAULT_FONT_SIZE) * DEFAULT_STROKE_WIDTH * scale_factor
393393

394394
def reverse_submobjects(self) -> None:
395395
self.mobject.invert(recursive=True)

0 commit comments

Comments
 (0)