stylo: Preserve the variant of rotate() values in computed transforms

MozReview-Commit-ID: Dmw7P21I6FN
This commit is contained in:
Manish Goregaokar 2017-09-11 17:16:07 -07:00 committed by Manish Goregaokar
parent e74d04c040
commit 06300999e9
4 changed files with 39 additions and 3 deletions

View file

@ -80,6 +80,18 @@ impl TransformList {
for operation in list {
let matrix = match *operation {
ComputedOperation::RotateX(theta) => {
let theta = Angle::from_radians(2.0f32 * f32::consts::PI - theta.radians());
Transform3D::create_rotation(1., 0., 0., theta.into())
}
ComputedOperation::RotateY(theta) => {
let theta = Angle::from_radians(2.0f32 * f32::consts::PI - theta.radians());
Transform3D::create_rotation(0., 1., 0., theta.into())
}
ComputedOperation::RotateZ(theta) => {
let theta = Angle::from_radians(2.0f32 * f32::consts::PI - theta.radians());
Transform3D::create_rotation(0., 0., 1., theta.into())
}
ComputedOperation::Rotate(ax, ay, az, theta) => {
let theta = Angle::from_radians(2.0f32 * f32::consts::PI - theta.radians());
let (ax, ay, az, theta) =