aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2016-06-25 22:35:20 -0700
committerMichael Howell <michael@notriddle.com>2016-06-28 17:18:34 -0700
commite10288ec1ce747cba0f1013faf43667fa3971da8 (patch)
treecfdeca557065379c7179e2942daf6e59a7132dcf /components
parentd3a81373e44634c30d31da0457e1c1e86c0911ed (diff)
downloadservo-e10288ec1ce747cba0f1013faf43667fa3971da8.tar.gz
servo-e10288ec1ce747cba0f1013faf43667fa3971da8.zip
Linearly interpolate rotation angles with equal direction
Fixes #11808, but still leaves matrix interpolation open.
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/helpers/animated_properties.mako.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs
index 3b75b4ee07b..b5a2eaef532 100644
--- a/components/style/properties/helpers/animated_properties.mako.rs
+++ b/components/style/properties/helpers/animated_properties.mako.rs
@@ -663,9 +663,14 @@ fn interpolate_transform_list(from_list: &[TransformOperation],
result.push(TransformOperation::Scale(ix, iy, iz));
}
(&TransformOperation::Rotate(fx, fy, fz, fa),
- &TransformOperation::Rotate(_tx, _ty, _tz, _ta)) => {
- // TODO(gw): Implement matrix decomposition and interpolation
- result.push(TransformOperation::Rotate(fx, fy, fz, fa));
+ &TransformOperation::Rotate(tx, ty, tz, ta)) => {
+ if fx == tx && fy == ty && fz == tz {
+ let ia = fa.interpolate(&ta, time).unwrap();
+ result.push(TransformOperation::Rotate(fx, fy, fz, ia));
+ } else {
+ // TODO(gw): Implement matrix decomposition and interpolation
+ result.push(TransformOperation::Rotate(fx, fy, fz, fa));
+ }
}
(&TransformOperation::Perspective(fd),
&TransformOperation::Perspective(_td)) => {