mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
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
This commit is contained in:
parent
66e8b04507
commit
c667136060
2 changed files with 2 additions and 2 deletions
|
@ -1361,7 +1361,7 @@ class Mobject(object):
|
|||
rgbs = resize_with_interpolation(rgbs, len(data))
|
||||
data[name][:, :3] = rgbs
|
||||
if opacity is not None:
|
||||
if not isinstance(opacity, (float, int)):
|
||||
if not isinstance(opacity, (float, int, np.floating)):
|
||||
opacity = resize_with_interpolation(np.array(opacity), len(data))
|
||||
data[name][:, 3] = opacity
|
||||
return self
|
||||
|
|
|
@ -185,7 +185,7 @@ 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
|
||||
if isinstance(width, (float, int)):
|
||||
if isinstance(width, (float, int, np.floating)):
|
||||
data['stroke_width'][:, 0] = width
|
||||
else:
|
||||
data['stroke_width'][:, 0] = resize_with_interpolation(
|
||||
|
|
Loading…
Add table
Reference in a new issue