mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Used np.clip in Animation.update
This commit is contained in:
parent
8e6c90563b
commit
b41e1fc562
1 changed files with 1 additions and 4 deletions
|
@ -48,10 +48,7 @@ class Animation(object):
|
||||||
return deepcopy(self)
|
return deepcopy(self)
|
||||||
|
|
||||||
def update(self, alpha):
|
def update(self, alpha):
|
||||||
if alpha < 0:
|
alpha = np.clip(alpha, 0, 1)
|
||||||
alpha = 0.0
|
|
||||||
if alpha > 1:
|
|
||||||
alpha = 1.0
|
|
||||||
self.update_mobject(self.rate_func(alpha))
|
self.update_mobject(self.rate_func(alpha))
|
||||||
|
|
||||||
def update_mobject(self, alpha):
|
def update_mobject(self, alpha):
|
||||||
|
|
Loading…
Add table
Reference in a new issue