mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Account for case of setting stroke width with null array
This commit is contained in:
parent
e37b667c8b
commit
d868f685dc
1 changed files with 4 additions and 4 deletions
|
@ -207,10 +207,10 @@ 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
|
||||||
data['stroke_width'][:, 0] = resize_with_interpolation(
|
width_arr = np.array(listify(width)).flatten()
|
||||||
np.array(listify(width)).flatten(),
|
if len(width_arr) == 0:
|
||||||
len(data['stroke_width'])
|
continue
|
||||||
)
|
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):
|
||||||
|
|
Loading…
Add table
Reference in a new issue