Skip to content

Commit d037b0a

Browse files
committed
handling for vmobject.height==0
1 parent 03f4b14 commit d037b0a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

manim/animation/creation.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,15 @@ def _adjust_stroke_width_for_text(
386386
) -> float:
387387
if stroke_width is not None:
388388
return stroke_width
389-
font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
390-
if font_size < 20 or font_size > 6 * DEFAULT_FONT_SIZE:
391-
# Assuming the user is using MovingCameraScene and performing a zoom-in or zoom-out
392-
return (font_size / DEFAULT_FONT_SIZE) * DEFAULT_STROKE_WIDTH * scale_factor
389+
if vmobject.height != 0:
390+
font_size = getattr(vmobject, "font_size", DEFAULT_FONT_SIZE)
391+
if font_size < 20 or font_size > 6 * DEFAULT_FONT_SIZE:
392+
# Assuming the user is using MovingCameraScene and performing a zoom-in or zoom-out
393+
return (
394+
(font_size / DEFAULT_FONT_SIZE)
395+
* DEFAULT_STROKE_WIDTH
396+
* scale_factor
397+
)
393398
return 2 # default in DrawBorderThenFill
394399

395400
def reverse_submobjects(self) -> None:

0 commit comments

Comments
 (0)