From b41e1fc562ab82033cbe0dd1e48d7afdcf91f033 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 18 Jan 2018 16:22:57 -0800 Subject: [PATCH] Used np.clip in Animation.update --- animation/animation.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/animation/animation.py b/animation/animation.py index 808ccdb8..e09ac58a 100644 --- a/animation/animation.py +++ b/animation/animation.py @@ -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):