mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Normalize rotations in computed transforms
This commit is contained in:
parent
1901a21a2c
commit
20b3c4bf21
4 changed files with 69 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue