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
Add simple easing functions #149
Add simple easing functions #149
Conversation
u0, u3 = 0,1; t in [0,1] | ||
equivalent to a normal bezier curve where p1x = 1/3 and p2x = 2/3 | ||
*/ | ||
let genOneDimBezierFunc = (u1:float, u2:float) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for setting this up, @Bretley 👍
); | ||
|
||
TestTicker.simulateTick(Time.Seconds(0.5)); | ||
expect(myAnimation.value.current).toBe(0.25); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks for the test!
examples/Bin.re
Outdated
@@ -100,43 +103,6 @@ module AnimatedText = ( | |||
) | |||
); | |||
|
|||
module SimpleButton = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to delete this here, or was it a merge issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryphe this is a merge issue for sure. At the time I was writing this, there was no button in the Bin.re test file. I tried to fetch upstream/master and then merge it with this branch, but git told me this branch was already up-to-date even though this code was missing. Not sure what commands I need to run to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. What I usually do for this is just get the latest, ie git checkout master examples/Bin.re
- and then reapply the changes (adding the easing functions). Think that's the easiest way here, but there may be other ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had one question around the <SimpleButton />
being deleted - otherwise looks good.
Looks great @Bretley , thank you! Will bring it once the build completes 👍 |
@bryphe
Progress update:
Test in AnimationTest.re does not actually change any of the other tests, only adds the quadratic one. I went back and checked this twice myself.
oneDimBezier alone is not enough to fully recreate the variety of css easing functions, but I'm 98% certain that a true bezier cubic could be made using [x,y] as a pair of oneDimBezier, then some math, then we can copy every CSS easing function offered.
New PR to get this all off of master and on to a feature branch :)