Eliminate AnimationFrame

This intermediate data structure doesn't really buy us anything and is a
bit confusing.
This commit is contained in:
Martin Robinson 2020-04-17 13:31:19 +02:00
parent 71940ff28c
commit a0b495750e
3 changed files with 28 additions and 62 deletions

View file

@ -80,8 +80,8 @@ pub fn update_animation_state<E>(
for mut running_animation in running_animations.drain(..) {
let still_running = !running_animation.is_expired() &&
match running_animation {
Animation::Transition(_, started_at, ref frame) => {
now < started_at + frame.duration
Animation::Transition(_, started_at, ref property_animation) => {
now < started_at + (property_animation.duration)
},
Animation::Keyframes(_, _, _, ref mut state) => {
// This animation is still running, or we need to keep
@ -100,12 +100,12 @@ pub fn update_animation_state<E>(
continue;
}
if let Animation::Transition(node, _, ref frame) = running_animation {
if let Animation::Transition(node, _, ref property_animation) = running_animation {
script_chan
.send(ConstellationControlMsg::TransitionEnd(
node.to_untrusted_node_address(),
frame.property_animation.property_name().into(),
frame.duration,
property_animation.property_name().into(),
property_animation.duration,
))
.unwrap();
}