Struct style::animation::KeyframesAnimationState
[−]
[src]
pub struct KeyframesAnimationState { pub started_at: f64, pub duration: f64, pub delay: f64, pub iteration_state: KeyframesIterationState, pub running_state: KeyframesRunningState, pub direction: AnimationDirection, pub current_direction: AnimationDirection, pub expired: bool, pub cascade_style: Arc<ComputedValues>, }
This structure represents the current keyframe animation state, i.e., the duration, the current and maximum iteration count, and the state (either playing or paused).
Fields
started_at: f64
The time this animation started at.
duration: f64
The duration of this animation.
delay: f64
The delay of the animation.
iteration_state: KeyframesIterationState
The current iteration state for the animation.
running_state: KeyframesRunningState
Werther this animation is paused.
direction: AnimationDirection
The declared animation direction of this animation.
current_direction: AnimationDirection
The current animation direction. This can only be normal
or reverse
.
expired: bool
Werther this keyframe animation is outdated due to a restyle.
cascade_style: Arc<ComputedValues>
The original cascade style, needed to compute the generated keyframes of the animation.
Methods
impl KeyframesAnimationState
[src]
pub fn tick(&mut self) -> bool
[src]
Performs a tick in the animation state, i.e., increments the counter of the current iteration count, updates times and then toggles the direction if appropriate.
Returns true if the animation should keep running.
pub fn update_from_other(&mut self, other: &Self, timer: &Timer)
[src]
Updates the appropiate state from other animation.
This happens when an animation is re-submitted to layout, presumably because of an state change.
There are some bits of state we can't just replace, over all taking in account times, so here's that logic.
Trait Implementations
impl Clone for KeyframesAnimationState
[src]
fn clone(&self) -> KeyframesAnimationState
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more