Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sugar/graphics/animator.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/sugar/graphics/animator.py b/sugar/graphics/animator.py
index 2021f42..60ff9f3 100644
--- a/sugar/graphics/animator.py
+++ b/sugar/graphics/animator.py
@@ -75,10 +75,14 @@ class Animation(object):
start = self.start
change = self.end - self.start
- if easing == EASE_OUT_EXPO:
- frame = change * (-pow(2, -10 * time/duration) + 1) + start;
- elif easing == EASE_IN_EXPO:
- frame = change * pow(2, 10 * (time / duration - 1)) + start;
+ if time == duration:
+ # last frame
+ frame = self.end
+ else:
+ if easing == EASE_OUT_EXPO:
+ frame = change * (-pow(2, -10 * time/duration) + 1) + start;
+ elif easing == EASE_IN_EXPO:
+ frame = change * pow(2, 10 * (time / duration - 1)) + start;
self.next_frame(frame)