Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-03-12 23:25:41 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-03-12 23:25:41 (GMT)
commitac8805246d61f105baff6340d06ccf55fa20a357 (patch)
treeaa796369f22f7d7045123416c0d52fa87df422a6 /sugar
parentd041eadf9220ff88e11181ce4d5465f9b07b1a8c (diff)
Actually use EASE_OUT by default, add EASE_IN.
Thanks to Dan to point this out.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/animator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sugar/graphics/animator.py b/sugar/graphics/animator.py
index 00b3e41..2021f42 100644
--- a/sugar/graphics/animator.py
+++ b/sugar/graphics/animator.py
@@ -19,7 +19,8 @@ import time
import gobject
-EASE_OUT_EXPO = 1
+EASE_OUT_EXPO = 0
+EASE_IN_EXPO = 1
class Animator(gobject.GObject):
__gsignals__ = {
@@ -75,6 +76,8 @@ class Animation(object):
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;
self.next_frame(frame)