Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace inner timing function (#2149)
## Description In timing animation, we use the following function to compute the value for the current frame of animation: ```js animation.current += ((toValue - current) * (newProgress - progress)) / (1 - progress); ``` But these function has asymptote in `progress = 1` and value 1 is inside function's domain. In summary, if progress was equal to 1 we had division by 0 in consequence `animation.current` was `NaN`. Android can't handle style with `NaN` value and this was a cause of blinking. I decided to change this function to a complementary form without asymptote: ```js animation.current = startValue + (toValue - startValue) * progress; ``` another possible solution (but imo worst): ```js const a = ((toValue - current) * (newProgress - progress)) / (1 - (progress == 1 ? 1 + Number.EPSILON : progress)) ``` Fixes #2079
- Loading branch information