Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-03-13 12:19:50 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-03-13 12:19:50 (GMT)
commitc58bb3549f195155e868aa46ddab8a39f60e82e1 (patch)
tree9a690c14625197931c02a79e02f8c07b455b77d4 /sugar
parentac8805246d61f105baff6340d06ccf55fa20a357 (diff)
Ensure animations reach last frame
Diffstat (limited to 'sugar')
-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)