From 197a20505f65507f7a578921421653967b79a8a1 Mon Sep 17 00:00:00 2001 From: Rotem Date: Mon, 27 Apr 2026 19:08:59 +0300 Subject: [PATCH] Add regression test for issue #4648 --- .../types/vectorized_mobject/test_stroke.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/module/mobject/types/vectorized_mobject/test_stroke.py b/tests/module/mobject/types/vectorized_mobject/test_stroke.py index 25c09cd294..4fdf622f64 100644 --- a/tests/module/mobject/types/vectorized_mobject/test_stroke.py +++ b/tests/module/mobject/types/vectorized_mobject/test_stroke.py @@ -1,7 +1,7 @@ from __future__ import annotations import manim.utils.color as C -from manim import VMobject +from manim import ORIGIN, NumberPlane, VMobject from manim.mobject.vector_field import StreamLines @@ -61,3 +61,20 @@ def test_background_stroke_scale(): b.scale(0.5, scale_stroke=True) assert a.get_stroke_width(background=True) == 50 assert b.get_stroke_width(background=True) == 25 + + +def test_scale_stroke_preserves_zero_width_on_number_plane_coordinates(): + """Regression for #4648: compound scale with scale_stroke must not add stroke to text labels.""" + npl = NumberPlane().add_coordinates() + zero_stroke_mobs = [ + mob + for mob in npl.get_family() + if isinstance(mob, VMobject) and mob.get_stroke_width() == 0 + ] + # Ensure we actually have objects with 0 stroke width to test + assert len(zero_stroke_mobs) > 0 + + npl.scale(0.01, scale_stroke=True, about_point=ORIGIN) + + for mob in zero_stroke_mobs: + assert mob.get_stroke_width() == 0