Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle more skew->rotation conversion cases #91

Merged
merged 4 commits into from
Oct 22, 2022

Conversation

ericente
Copy link
Collaborator

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, and skewX + 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.

Copy link
Collaborator

@andrewstart andrewstart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding/updating comments to reflect what you've learned about the intricacies of how skew is handled?

@andrewstart andrewstart merged commit 205c4b3 into master Oct 22, 2022
@andrewstart andrewstart deleted the fix-skew-rotation-fix branch October 22, 2022 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants