Actually use EASE_OUT by default, add EASE_IN.

Thanks to Dan to point this out.
This commit is contained in:
Marco Pesenti Gritti 2007-03-13 00:25:41 +01:00
parent d041eadf92
commit ac8805246d

View File

@ -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)