mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
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
7ea15a8bf9
commit
b4eed687b0
3 changed files with 4 additions and 4 deletions
|
@ -164,10 +164,10 @@ class VFadeIn(Animation):
|
||||||
alpha: float
|
alpha: float
|
||||||
) -> None:
|
) -> None:
|
||||||
submob.set_stroke(
|
submob.set_stroke(
|
||||||
opacity=float(interpolate(0, start.get_stroke_opacity(), alpha))
|
opacity=interpolate(0, start.get_stroke_opacity(), alpha)
|
||||||
)
|
)
|
||||||
submob.set_fill(
|
submob.set_fill(
|
||||||
opacity=float(interpolate(0, start.get_fill_opacity(), alpha))
|
opacity=interpolate(0, start.get_fill_opacity(), alpha)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1361,7 +1361,7 @@ class Mobject(object):
|
||||||
rgbs = resize_with_interpolation(rgbs, len(data))
|
rgbs = resize_with_interpolation(rgbs, len(data))
|
||||||
data[name][:, :3] = rgbs
|
data[name][:, :3] = rgbs
|
||||||
if opacity is not None:
|
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))
|
opacity = resize_with_interpolation(np.array(opacity), len(data))
|
||||||
data[name][:, 3] = opacity
|
data[name][:, 3] = opacity
|
||||||
return self
|
return self
|
||||||
|
|
|
@ -185,7 +185,7 @@ 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
|
||||||
if isinstance(width, (float, int)):
|
if isinstance(width, (float, int, np.floating)):
|
||||||
data['stroke_width'][:, 0] = width
|
data['stroke_width'][:, 0] = width
|
||||||
else:
|
else:
|
||||||
data['stroke_width'][:, 0] = resize_with_interpolation(
|
data['stroke_width'][:, 0] = resize_with_interpolation(
|
||||||
|
|
Loading…
Add table
Reference in a new issue