Ensure animations reach last frame
This commit is contained in:
parent
ac8805246d
commit
c58bb3549f
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user