Handle more skew->rotation conversion cases #91
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I made a mistake in my previous skew-rotation conversion fix. (#89) That change addressed a particular issue where skew values that we'd expect to see as
(-Pi, Pi)
actually were coming through as(Pi, Pi)
(Pi and -Pi are equivalent values for skew), and I thought there was a mistake in the original code, not realizing that Pixi's skewX is inverted from Animate's skewX.As far as I know, this new update should handle all cases where skew values can be converted to rotation values. We now handle:
skewX === -skewY
,skewX === skewY && skewX === Math.PI
, andskewX + skewY === 2 * Math.PI
.I'm not sure if it's possible to get skew values that unexpectedly fall outside of the bounds because of rounding errors when comparing to Pi, but I've attempted to reduce this likelihood, and haven't seen it happen in initial tests. If there are failures to convert to rotation, they should still be displayed correctly in the runtime once a correction is published for rotation<->skew tweening.