Skip to content

Fix inconsistencies in the behavior of getFrameNumber#98

Open
sgrif wants to merge 1 commit intosupereggbert:masterfrom
sgrif:sg-fix-frame-number
Open

Fix inconsistencies in the behavior of getFrameNumber#98
sgrif wants to merge 1 commit intosupereggbert:masterfrom
sgrif:sg-fix-frame-number

Conversation

@sgrif
Copy link
Copy Markdown

@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