Fix event loop being blocked because it wouldn't notice that animation is still running

The active_animation was set to false, but if the animation tick did not change, the animation tick
was not maked dirty, and we wouldn't then re-evaluate animated property that would set the
active_animation to true again
This commit is contained in:
Olivier Goffart 2020-12-09 17:25:49 +01:00
parent c72c2a58ff
commit e75f617125
2 changed files with 5 additions and 3 deletions

View file

@ -98,8 +98,10 @@ impl AnimationDriver {
/// Iterates through all animations based on the new time tick and updates their state. This should be called by
/// the windowing system driver for every frame.
pub fn update_animations(&self, new_tick: Instant) {
self.active_animations.set(false);
self.global_instant.as_ref().set(new_tick);
if self.global_instant.as_ref().get() != new_tick {
self.active_animations.set(false);
self.global_instant.as_ref().set(new_tick);
}
}
/// Returns true if there are any active or ready animations. This is used by the windowing system to determine