Skip to content

_transitionHasCompleted #6

Open
@ggcrunchy

Description

@ggcrunchy

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions