From d386d6d1f1e1dba33b49e0b44d9216128f29da1c Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Thu, 23 Apr 2020 17:06:24 +0200 Subject: Add support for transitionrun events These events are triggered as soon as a transition is added to the list of running transitions. This will allow better test coverage while reworking the transitions and animations processing model. --- components/layout_thread/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'components/layout_thread/lib.rs') diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 6272147b65e..4a346315e8a 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1762,13 +1762,18 @@ impl LayoutThread { .map(|nodes| nodes.lock().unwrap()); let newly_transitioning_nodes = newly_transitioning_nodes.as_mut().map(|nodes| &mut **nodes); - // Kick off animations if any were triggered, expire completed ones. - animation::update_animation_states::( + let mut animation_states = self.animation_states.write(); + + animation::collect_newly_transitioning_nodes( + &animation_states, + newly_transitioning_nodes, + ); + + animation::update_animation_states( &self.constellation_chan, &self.script_chan, - &mut *self.animation_states.write(), + &mut *animation_states, invalid_nodes, - newly_transitioning_nodes, self.id, &self.timer, ); -- cgit v1.2.3