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

Fix inconsistencies in the behavior of getFrameNumber #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgrif
Copy link

@sgrif sgrif commented Jan 14, 2014

Setting the start frame or anim frames of an animatible to 0 is not the
same as that variable not being set. If startFrame == 0 and
animFrames == 307, and getFrameNumber() returns 307 at the end of
an animation, then one can infer that starting at frame 100 would be
accomplished like so:

var frameCount = 307;

function jumpToFrame(frameNumber) {
  animatable.setStartFrame(frameNumber);
  animatable.setFrames(frameCount - frameNumber);
}

However, if that function were to be called with 307, the animation will
play from frame 307 to 614 (leading to unexpected results).

Additionally, if playing that entire animation from frame 100 to 307
results in getFrameNumber() returning 307 the moment the animation
ends, then it should continue returning 307, and not change to 207 30ms
later.

Setting the start frame or anim frames of an animatible to 0 is not the
same as that variable not being set. If `startFrame == 0` and
`animFrames == 307`, and `getFrameNumber()` returns 307 at the end of
an animation, then one can infer that starting at frame 100 would be
accomplished like so:

    var frameCount = 307;

    function jumpToFrame(frameNumber) {
      animatable.setStartFrame(frameNumber);
      animatable.setFrames(frameCount - frameNumber);
    }

However, if that function were to be called with 307, the animation will
play from frame 307 to 614 (leading to unexpected results).

Additionally, if playing that entire animation from frame 100 to 307
results in `getFrameNumber()` returning 307 the moment the animation
ends, then it should continue returning 307, and not change to 207 30ms
later.
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

Successfully merging this pull request may close these issues.

1 participant