In VMobject.set_stroke, Don't use resize_with_interpolation for non-list args

This commit is contained in:
Grant Sanderson 2023-01-19 09:56:26 -08:00
parent 93f3c6535f
commit dbeef42600

View file

@ -199,10 +199,9 @@ class VMobject(Mobject):
if width is not None: if width is not None:
for mob in self.get_family(recurse): for mob in self.get_family(recurse):
data = mob.data if mob.get_num_points() > 0 else mob._data_defaults data = mob.data if mob.get_num_points() > 0 else mob._data_defaults
width_arr = np.array(listify(width)).flatten() if not isinstance(width, float | int):
if len(width_arr) == 0: width = resize_with_interpolation(np.array(width), len(data)).flatten()
continue data['stroke_width'][:, 0] = width
data['stroke_width'][:, 0] = resize_with_interpolation(width_arr, len(data))
if background is not None: if background is not None:
for mob in self.get_family(recurse): for mob in self.get_family(recurse):