Bug: Matrix decompose()
method doesn't work correctly with mirrored matrix
#11197
Labels
🕷 Bug
Verified that it’s actually a legit bug that exists in the current release.
Medium Priority
These are PRs or issues that are important to address
Current Behavior
When a
Matrix
with a rotation has a "mirroring" scale, such as -1 across X or Y axis, calling.decompose()
on the matrix produces skew values, and no rotation value, on the returnedTransform
object.Expected Behavior
The basis vectors of the matrix are still orthogonal in this case, so
.decompose()
should return a rotation if the matrix has a rotation. No skew values.Steps to Reproduce
Matrix
.rotate(rad)
.scale(-1, 1)
Transform
.decompose(t)
t.rotation
is 0Environment
pixi.js
version: 8.6.6Possible Solution
The 2nd condition in this check should be expanded, though I'm not sure exactly what would be best. In my x-mirror example,
delta
was PI, and the condition failed.Additional Information
No response
The text was updated successfully, but these errors were encountered: