Repository navigation
Conversation
Replace the sample table + Newton-Raphson + bisection search with the closed-form solver of bezier-easing 3.2: exact (~1e-14 instead of up to ~1e-3), no backward jump on steep curves such as (1, 0, 0, 1), faster. Inputs outside [0, 1] now saturate to 0 / 1 instead of going through the old search, which returned arbitrary values there.
27 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
Hi, this is @gre, I'm the author of bezier-easing, which is also embedded in this project (
packages/react-native/Libraries/Animated/bezier.js). The library was recently improved with better performance and more reliability, and I wanted to backport the benefits here.This brings its 3.2 solver (closed-form, no sample table):
Easing.bezier(1, 0, 0, 1)(0.4996)returned 0.348 instead of 0.431, and the value went backwards around the middle.Easing.ease) to ~1e-14.Easing.bezier(0.25, 0.1, 0.25, 1)(-0.5)gave 0.39). This is visible withinterpolate+extrapolate: 'extend'. Linear curves are unchanged.Changelog:
[GENERAL] [FIXED] -
Easing.bezier: fix wrong values on steep curves such as(1, 0, 0, 1); input outside [0, 1] now saturatesTest Plan:
bezier-itest.js.yarn fantom packages/react-native/Libraries/Animated/passes, andyarn flow check, eslint and prettier are clean.