mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #13275 - canaltinova:rotate, r=Manishearth
Normalize rotations in computed transforms <!-- Please describe your changes on the following line: --> Normalize rotations in computed transforms. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13265 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13275) <!-- Reviewable:end -->
This commit is contained in:
commit
2024487913
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