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

_transitionHasCompleted #6

Open
ggcrunchy opened this issue May 25, 2022 · 0 comments
Open

_transitionHasCompleted #6

ggcrunchy opened this issue May 25, 2022 · 0 comments

Comments

@ggcrunchy
Copy link

A weird issue here.

tween._transitionHasCompleted is set to false (unnecessarily, I think; the default nil would already do the same job), but never to true, in particular in the if part just above. I think the cases where this flag is tested might actually be okay, since the tween has already been added to the completed listeners and then quickly evicted, but I'm not certain.


Since I figured at this point the library details will be, at best, slow to change, I wrote some predicates making use of internal members: IsCancelled(), IsCompleted(), etc. That's where I ran afoul of this. 😃 In an earlier iteration of these APIs I was using the onComplete handler and friends, piggybacking any user-provided listeners atop them if needed; however, doing so artificially limited the logic to transitions launched by my own wrappers, and this even affected other utilities in the same module.

Lacking a proper _transitionHasCompleted, my current fallback is "not paused, and the time has elapsed?", basically mirroring the logic in the library. This will be very slightly off the event.time used internally, so occasionally will be a frame off, but it's probably not so bad.

Anyhow, I'd submit a PR if this were urgent, but I mostly wanted to mention it. Maybe adding some predicates like I described, officially, would be a decent idea? (I have similar stuff for timers, though without problems there.)

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

No branches or pull requests

1 participant