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

Correct the initialization of the variable "firstTick" #827

Merged
merged 1 commit into from
Jan 6, 2018

Conversation

Pointy
Copy link
Contributor

@Pointy Pointy commented Dec 27, 2017

In the "tick" handler code, there's a flag called firstTick that is used to avoid updating a property value that's already correct for the current tween. However, firstTick is initialized based on the state of the timeStart value, which is unset on the first tick; the initialization incorrectly inverts that test, using !!timeStart instead of !timeStart.

The upshot of this is that the test to avoid updating a property an all but the first tick actually only avoids updating the property on the first tick; for most of the animation that optimization is ignored. Worse, that can cause issues for force-fed property values that might need initialization on that first tick (see issue 543).

@Rycochet
Copy link
Collaborator

Ugh, good catch - will get this merged when v2 is out and v1 moves into a maintenance branch, thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants