Closed okikio closed 2 years ago
Shouldn't this be named INFINITE_LOOP_LIMIT
(with an f instead of t)?
Also maybe it would be an idea to use Number.MAX_SAFE_INTEGER
instead of 10,000
?
I think there are times people would want an infinite loop though...
(Like if you had a terminal blinking, it could blink the underscore infinitely...)
While calculating the spring easing, the for loop can sometimes encounter infinite loops that cause the browser to freeze, I've run into this problem a couple times. I choose 10,000 because it was the value that allowed for the most accurate spring easings while avoiding the browser freezing for extended periods of time.
While calculating the spring the for loop can sometimes encounter infinite loops, that cause the browser to freeze, I've run into this problem a couple times.
That is true, but I hope there is an alternative method added, to allow things like my example, to work.
While calculating the spring the for loop can sometimes encounter infinite loops, that cause the browser to freeze, I've run into this problem a couple times.
That is true, but I hope there is an alternative method added, to allow things like my example, to work.
What you're looking for is different from what this pr is aiming to fix, but yeah I agree with you, it would be cool if animejs supported blinking animation
While calculating the spring the for loop can sometimes encounter infinite loops, that cause the browser to freeze, I've run into this problem a couple times.
That is true, but I hope there is an alternative method added, to allow things like my example, to work.
What you're looking for is different from what this pr is aiming to fix, but yeah I agree with you, it would be cool if animejs supported blinking animation
Yeah, just making sure it doesn't break what I am using it for lol.
While calculating the spring easing, the for loop can sometimes encounter infinite loops that cause the browser to freeze, I've run into this problem a couple times. I choose 10,000 because it was the value that allowed for the most accurate spring easings while avoiding the browser freezing for extended periods of time.
Could you post the code which freezes the browser please? Maybe there's another solution to the problem.
@RafaelKr There was something wrong with this pr, it seems the branch repo the changes were located in were deleted, so, I had to recreate a new pr. The new pr is #798, I'll close this one, we can continue our conversation there.
The way the
getDuration()
method in thespring()
function is setup it doesn't have any way of stopping an infinite loop. I added aINTINITE_LOOP_LIMIT
of 10,000 to stop possible infinite loop situations.