aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorNazım Can Altınova <canaltinova@gmail.com>2016-09-15 15:32:34 +0300
committerNazım Can Altınova <canaltinova@gmail.com>2016-09-15 17:26:21 +0300
commit20b3c4bf21b8cc2bdc378a77e180cfaa0ec242fc (patch)
tree6f766868aebb6e35807d21be41571ca12f8fe575 /components
parent1901a21a2c179e5bb439609402a4e1cb9f5c08d1 (diff)
downloadservo-20b3c4bf21b8cc2bdc378a77e180cfaa0ec242fc.tar.gz
servo-20b3c4bf21b8cc2bdc378a77e180cfaa0ec242fc.zip
Normalize rotations in computed transforms
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/longhand/effects.mako.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/style/properties/longhand/effects.mako.rs b/components/style/properties/longhand/effects.mako.rs
index 6e58419ce45..c7865e53ba0 100644
--- a/components/style/properties/longhand/effects.mako.rs
+++ b/components/style/properties/longhand/effects.mako.rs
@@ -1099,7 +1099,8 @@ ${helpers.predefined_type("opacity",
result.push(computed_value::ComputedOperation::Scale(sx, sy, sz));
}
SpecifiedOperation::Rotate(ax, ay, az, theta) => {
- result.push(computed_value::ComputedOperation::Rotate(ax, ay, az, theta));
+ let len = (ax * ax + ay * ay + az * az).sqrt();
+ result.push(computed_value::ComputedOperation::Rotate(ax / len, ay / len, az / len, theta));
}
SpecifiedOperation::Skew(theta_x, theta_y) => {
result.push(computed_value::ComputedOperation::Skew(theta_x, theta_y));