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

Fix animation strategies IN_EXPO and OUT_EXPO. #129

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

RedEpicness
Copy link
Contributor

@RedEpicness RedEpicness commented Nov 13, 2023

The strategies didn't completely follow the provided code from https://easings.net/en and would return, for example with OUT_EXPO, 0.999 when percentComplete would be 1.0.

Copy link
Contributor

@Johni0702 Johni0702 left a comment

Choose a reason for hiding this comment

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

Does this not affect IN_OUT_EXP too?
Could probably just implement that in terms of IN_EXP and OUT_EXP instead of having an exact duplicate of their math in there. (well, almost exact duplicate: + 1 + 1 has been simplified to + 2)

Also, any reason to not use <= (or >=) instead of ==? Seems odd to have a discontinuous jump at 0 (or 1) but then go back to a small non-zero value immediately after. Granted, you're probably not supposed to pass values outside the range, but it's trivial to allow and gives reasonable values, so may as well.

@RedEpicness
Copy link
Contributor Author

Ah yeah, it does affect IN_OUT_EXP too. I'll remove the duplicate code.

No specific reasoning behind ==, I just followed the examples directly.

@Johni0702 Johni0702 merged commit 3f43410 into master Nov 28, 2023
1 check passed
@Johni0702 Johni0702 deleted the fix/fix-animation-strategies branch November 28, 2023 14:26
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