mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: WTF I was thinking about when I wrote that?
This commit is contained in:
parent
33f581883b
commit
2b2e58a868
2 changed files with 2 additions and 9 deletions
|
@ -139,7 +139,6 @@ pub fn recalc_style_for_animations(context: &SharedLayoutContext,
|
||||||
animation,
|
animation,
|
||||||
&mut fragment.style,
|
&mut fragment.style,
|
||||||
Some(&mut damage));
|
Some(&mut damage));
|
||||||
animation.increment_keyframe_if_applicable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,11 @@ impl KeyframesAnimationState {
|
||||||
///
|
///
|
||||||
/// Returns true if the animation should keep running.
|
/// Returns true if the animation should keep running.
|
||||||
pub fn tick(&mut self) -> bool {
|
pub fn tick(&mut self) -> bool {
|
||||||
|
debug!("KeyframesAnimationState::tick");
|
||||||
let still_running = match self.iteration_state {
|
let still_running = match self.iteration_state {
|
||||||
KeyframesIterationState::Finite(ref mut current, ref max) => {
|
KeyframesIterationState::Finite(ref mut current, ref max) => {
|
||||||
*current += 1;
|
*current += 1;
|
||||||
|
debug!("KeyframesAnimationState::tick: current={}, max={}", current, max);
|
||||||
*current < *max
|
*current < *max
|
||||||
}
|
}
|
||||||
KeyframesIterationState::Infinite => true,
|
KeyframesIterationState::Infinite => true,
|
||||||
|
@ -120,14 +122,6 @@ impl Animation {
|
||||||
Animation::Keyframes(_, _, ref state) => state.paused,
|
Animation::Keyframes(_, _, ref state) => state.paused,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn increment_keyframe_if_applicable(&mut self) {
|
|
||||||
if let Animation::Keyframes(_, _, ref mut state) = *self {
|
|
||||||
if let KeyframesIterationState::Finite(ref mut iterations, _) = state.iteration_state {
|
|
||||||
*iterations += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue