Normalize rotations in computed transforms

This commit is contained in:
Nazım Can Altınova 2016-09-15 15:32:34 +03:00
parent 1901a21a2c
commit 20b3c4bf21
4 changed files with 69 additions and 1 deletions

View file

@ -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));