mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Allow cross interpolation between differing translate/scale functions
See ToPrimitive() in StyleAnimationValue.cpp
This commit is contained in:
parent
f699b8cfb2
commit
9c9a181f35
4 changed files with 12 additions and 3 deletions
|
@ -1226,7 +1226,12 @@ impl Animate for ComputedTransformOperation {
|
|||
fd_matrix.animate(&td_matrix, procedure)?,
|
||||
))
|
||||
},
|
||||
// XXXManishearth handle crossover between translate and scale functions
|
||||
(ref f, ref t) if f.is_translate() && t.is_translate() => {
|
||||
f.to_translate_3d().animate(&t.to_translate_3d(), procedure)
|
||||
}
|
||||
(ref f, ref t) if f.is_scale() && t.is_scale() => {
|
||||
f.to_scale_3d().animate(&t.to_scale_3d(), procedure)
|
||||
}
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -706,6 +706,11 @@ impl CSSPixelLength {
|
|||
pub fn abs(self) -> Self {
|
||||
CSSPixelLength::new(self.0.abs())
|
||||
}
|
||||
|
||||
/// Zero value
|
||||
pub fn zero() -> Self {
|
||||
CSSPixelLength::new(0.)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for CSSPixelLength {
|
||||
|
|
|
@ -249,7 +249,6 @@ pub struct Transform<T>(pub Vec<T>);
|
|||
|
||||
impl<Angle, Number, Length, Integer, LengthOrNumber, LengthOrPercentage, LoPoNumber>
|
||||
TransformOperation<Angle, Number, Length, Integer, LengthOrNumber, LengthOrPercentage, LoPoNumber> {
|
||||
|
||||
/// Check if it is any translate function
|
||||
pub fn is_translate(&self) -> bool {
|
||||
use self::TransformOperation::*;
|
||||
|
|
|
@ -10,8 +10,8 @@ use selectors::parser::SelectorParseErrorKind;
|
|||
use style_traits::{ParseError, StyleParseErrorKind};
|
||||
use values::computed::{Context, LengthOrPercentage as ComputedLengthOrPercentage};
|
||||
use values::computed::{Percentage as ComputedPercentage, ToComputedValue};
|
||||
use values::generics::transform::{Matrix3D, Transform as GenericTransform};
|
||||
use values::computed::transform::TimingFunction as ComputedTimingFunction;
|
||||
use values::generics::transform::{Matrix3D, Transform as GenericTransform};
|
||||
use values::generics::transform::{StepPosition, TimingFunction as GenericTimingFunction, Matrix};
|
||||
use values::generics::transform::{TimingKeyword, TransformOrigin as GenericTransformOrigin};
|
||||
use values::generics::transform::TransformOperation as GenericTransformOperation;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue