Skip to content

Commit

Permalink
Linearly interpolate rotation angles with equal direction
Browse files Browse the repository at this point in the history
Fixes #11808, but still leaves matrix interpolation open.
  • Loading branch information
notriddle committed Jun 29, 2016
1 parent d3a8137 commit e10288e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/style/properties/helpers/animated_properties.mako.rs
Expand Up @@ -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)) => {
Expand Down

0 comments on commit e10288e

Please sign in to comment.