mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 22:13:30 +08:00
Used np.clip in Animation.update
This commit is contained in:
@ -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):
|
||||||
|
Reference in New Issue
Block a user