From dbeef4260096b175a7131081edb46ce4b31fb356 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 19 Jan 2023 09:56:26 -0800 Subject: [PATCH] In VMobject.set_stroke, Don't use resize_with_interpolation for non-list args --- manimlib/mobject/types/vectorized_mobject.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index 13ef447e..8ea51c2c 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -199,10 +199,9 @@ class VMobject(Mobject): if width is not None: for mob in self.get_family(recurse): data = mob.data if mob.get_num_points() > 0 else mob._data_defaults - width_arr = np.array(listify(width)).flatten() - if len(width_arr) == 0: - continue - data['stroke_width'][:, 0] = resize_with_interpolation(width_arr, len(data)) + if not isinstance(width, float | int): + width = resize_with_interpolation(np.array(width), len(data)).flatten() + data['stroke_width'][:, 0] = width if background is not None: for mob in self.get_family(recurse):