animations: Don't apply animation delay to every iteration

The delay should only be applied to the animation before the first
iteration.
This commit is contained in:
Martin Robinson 2020-06-18 16:26:28 +02:00
parent 6d9b2eef29
commit f92164144e
4 changed files with 110 additions and 7 deletions

View file

@ -483,7 +483,7 @@ impl Animation {
// Update the next iteration direction if applicable.
// TODO(mrobinson): The duration might now be wrong for floating point iteration counts.
self.started_at += self.duration + self.delay;
self.started_at += self.duration;
match self.direction {
AnimationDirection::Alternate | AnimationDirection::AlternateReverse => {
self.current_direction = match self.current_direction {