From ce45f68d9c07b34cb017ec0fe89de542f0771744 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 22 May 2023 14:56:11 +0200 Subject: [PATCH] style: Update euclid in stylo Differential Revision: https://phabricator.services.mozilla.com/D85762 --- components/style/values/generics/transform.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs index 1733baa2d23..95f5e999b77 100644 --- a/components/style/values/generics/transform.rs +++ b/components/style/values/generics/transform.rs @@ -443,32 +443,31 @@ where use self::TransformOperation::*; use std::f64; - const TWO_PI: f64 = 2.0f64 * f64::consts::PI; let reference_width = reference_box.map(|v| v.size.width); let reference_height = reference_box.map(|v| v.size.height); let matrix = match *self { Rotate3D(ax, ay, az, theta) => { - let theta = TWO_PI - theta.radians64(); + let theta = theta.radians64(); let (ax, ay, az, theta) = get_normalized_vector_and_angle(ax.into(), ay.into(), az.into(), theta); Transform3D::rotation( ax as f64, ay as f64, az as f64, - -euclid::Angle::radians(theta), + euclid::Angle::radians(theta), ) }, RotateX(theta) => { - let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); - Transform3D::rotation(1., 0., 0., -theta) + let theta = euclid::Angle::radians(theta.radians64()); + Transform3D::rotation(1., 0., 0., theta) }, RotateY(theta) => { - let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); - Transform3D::rotation(0., 1., 0., -theta) + let theta = euclid::Angle::radians(theta.radians64()); + Transform3D::rotation(0., 1., 0., theta) }, RotateZ(theta) | Rotate(theta) => { - let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); - Transform3D::rotation(0., 0., 1., -theta) + let theta = euclid::Angle::radians(theta.radians64()); + Transform3D::rotation(0., 0., 1., theta) }, Perspective(ref d) => { let m = create_perspective_matrix(d.to_pixel_length(None)?);