Skip to content

Commit c667136

Browse files
authored
Fix error when using VFadeIn (and its subclasses) (#2328)
* Fix error when using VFadeIn and its subclasses * add np.floating in type checking of Mobject.set_rgba_array_by_color and VMobject.set_stroke and removing the change in VFadeIn
1 parent 66e8b04 commit c667136

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

manimlib/mobject/mobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ def set_rgba_array_by_color(
13611361
rgbs = resize_with_interpolation(rgbs, len(data))
13621362
data[name][:, :3] = rgbs
13631363
if opacity is not None:
1364-
if not isinstance(opacity, (float, int)):
1364+
if not isinstance(opacity, (float, int, np.floating)):
13651365
opacity = resize_with_interpolation(np.array(opacity), len(data))
13661366
data[name][:, 3] = opacity
13671367
return self

manimlib/mobject/types/vectorized_mobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def set_stroke(
185185
if width is not None:
186186
for mob in self.get_family(recurse):
187187
data = mob.data if mob.get_num_points() > 0 else mob._data_defaults
188-
if isinstance(width, (float, int)):
188+
if isinstance(width, (float, int, np.floating)):
189189
data['stroke_width'][:, 0] = width
190190
else:
191191
data['stroke_width'][:, 0] = resize_with_interpolation(

0 commit comments

Comments
 (0)