mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
This commit is contained in:
parent
0cceeb9d5c
commit
aea0cd7ec7
23 changed files with 876 additions and 937 deletions
|
@ -1401,15 +1401,15 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
})
|
||||
}
|
||||
|
||||
fn needs_transitions_update_per_property(&self,
|
||||
property: &TransitionProperty,
|
||||
combined_duration: f32,
|
||||
before_change_style: &ComputedValues,
|
||||
after_change_style: &ComputedValues,
|
||||
existing_transitions: &HashMap<TransitionProperty,
|
||||
Arc<AnimationValue>>)
|
||||
-> bool {
|
||||
use properties::animated_properties::Animatable;
|
||||
fn needs_transitions_update_per_property(
|
||||
&self,
|
||||
property: &TransitionProperty,
|
||||
combined_duration: f32,
|
||||
before_change_style: &ComputedValues,
|
||||
after_change_style: &ComputedValues,
|
||||
existing_transitions: &HashMap<TransitionProperty, Arc<AnimationValue>>,
|
||||
) -> bool {
|
||||
use values::animated::{Animate, Procedure};
|
||||
|
||||
// |property| should be an animatable longhand
|
||||
let animatable_longhand = AnimatableLonghand::from_transition_property(property).unwrap();
|
||||
|
@ -1431,7 +1431,7 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
|
||||
combined_duration > 0.0f32 &&
|
||||
from != to &&
|
||||
from.interpolate(&to, 0.5).is_ok()
|
||||
from.animate(&to, Procedure::Interpolate { progress: 0.5 }).is_ok()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue