Ensure animations reach last frame

This commit is contained in:
Dan Williams 2007-03-13 08:19:50 -04:00
parent ac8805246d
commit c58bb3549f

View File

@ -75,10 +75,14 @@ class Animation(object):
start = self.start start = self.start
change = self.end - self.start change = self.end - self.start
if easing == EASE_OUT_EXPO: if time == duration:
frame = change * (-pow(2, -10 * time/duration) + 1) + start; # last frame
elif easing == EASE_IN_EXPO: frame = self.end
frame = change * pow(2, 10 * (time / duration - 1)) + start; 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) self.next_frame(frame)