Used np.clip in Animation.update

This commit is contained in:
Grant Sanderson
2018-01-18 16:22:57 -08:00
parent 8e6c90563b
commit b41e1fc562

View File

@ -48,10 +48,7 @@ class Animation(object):
return deepcopy(self)
def update(self, alpha):
if alpha < 0:
alpha = 0.0
if alpha > 1:
alpha = 1.0
alpha = np.clip(alpha, 0, 1)
self.update_mobject(self.rate_func(alpha))
def update_mobject(self, alpha):