mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Fix TransformOperation.animate() implementation
This commit is contained in:
parent
06300999e9
commit
a7a5adb71a
2 changed files with 67 additions and 1 deletions
|
@ -1230,6 +1230,30 @@ impl Animate for TransformOperation {
|
||||||
fz.animate(tz, procedure)?,
|
fz.animate(tz, procedure)?,
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::TranslateX(ref from),
|
||||||
|
&TransformOperation::TranslateX(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::TranslateX(
|
||||||
|
from.animate(to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::TranslateY(ref from),
|
||||||
|
&TransformOperation::TranslateY(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::TranslateY(
|
||||||
|
from.animate(to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::TranslateZ(ref from),
|
||||||
|
&TransformOperation::TranslateZ(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::TranslateZ(
|
||||||
|
from.animate(to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
(
|
(
|
||||||
&TransformOperation::Scale(ref fx, ref fy, ref fz),
|
&TransformOperation::Scale(ref fx, ref fy, ref fz),
|
||||||
&TransformOperation::Scale(ref tx, ref ty, ref tz),
|
&TransformOperation::Scale(ref tx, ref ty, ref tz),
|
||||||
|
@ -1240,6 +1264,48 @@ impl Animate for TransformOperation {
|
||||||
animate_multiplicative_factor(*fz, *tz, procedure)?,
|
animate_multiplicative_factor(*fz, *tz, procedure)?,
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::ScaleX(ref from),
|
||||||
|
&TransformOperation::ScaleX(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::ScaleX(
|
||||||
|
animate_multiplicative_factor(*from, *to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::ScaleY(ref from),
|
||||||
|
&TransformOperation::ScaleY(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::ScaleY(
|
||||||
|
animate_multiplicative_factor(*from, *to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::ScaleZ(ref from),
|
||||||
|
&TransformOperation::ScaleZ(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::ScaleZ(
|
||||||
|
animate_multiplicative_factor(*from, *to, procedure)?,
|
||||||
|
))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::RotateX(ref from),
|
||||||
|
&TransformOperation::RotateX(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::RotateX(from.animate(to, procedure)?))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::RotateY(ref from),
|
||||||
|
&TransformOperation::RotateY(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::RotateY(from.animate(to, procedure)?))
|
||||||
|
},
|
||||||
|
(
|
||||||
|
&TransformOperation::RotateZ(ref from),
|
||||||
|
&TransformOperation::RotateZ(ref to),
|
||||||
|
) => {
|
||||||
|
Ok(TransformOperation::RotateZ(from.animate(to, procedure)?))
|
||||||
|
},
|
||||||
(
|
(
|
||||||
&TransformOperation::Rotate(fx, fy, fz, fa),
|
&TransformOperation::Rotate(fx, fy, fz, fa),
|
||||||
&TransformOperation::Rotate(tx, ty, tz, ta),
|
&TransformOperation::Rotate(tx, ty, tz, ta),
|
||||||
|
|
|
@ -128,7 +128,7 @@ impl TransformList {
|
||||||
Transform3D::create_translation(0., ty, 0.)
|
Transform3D::create_translation(0., ty, 0.)
|
||||||
}
|
}
|
||||||
ComputedOperation::TranslateZ(tz) => {
|
ComputedOperation::TranslateZ(tz) => {
|
||||||
Transform3D::create_translation(0., 0., tz.to_f32_px())
|
Transform3D::create_translation(0., 0., tz.px())
|
||||||
}
|
}
|
||||||
ComputedOperation::Translate(tx, ty, tz) => {
|
ComputedOperation::Translate(tx, ty, tz) => {
|
||||||
let (tx, ty) = match reference_box {
|
let (tx, ty) = match reference_box {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue