@dtex @rwaldron
Hello guys, hope you're well.
First issue
When using the Animation API there is no way out from onloop callback using animation.next
The next function is watch for isRunning === true and prevent going to next.
|
next() { |
|
|
|
if (this.isRunning) { |
|
return this; |
|
} else { |
|
this.isRunning = true; |
|
} |
If we call pause right before, this is not working too because it doesn't turn running false.
|
pause() { |
|
|
|
this.emit("animation:pause"); |
|
|
|
if (this.playLoop) { |
|
this.playLoop.stop(); |
|
} |
|
this.paused = true; |
|
|
|
if (this.onpause) { |
|
this.onpause(); |
|
} |
|
|
|
} |
if we call stop we clear the stack because this
So we can't go to the next animation.
Only solution is to call stop and trigger a new animation from within the callback.
Second issue
oncomplete callback is not called for current animation when using stop(). But it only call onStop
Maybe we could think about something else ?
@dtex @rwaldron
Hello guys, hope you're well.
First issue
When using the Animation API there is no way out from
onloopcallback usinganimation.nextThe
nextfunction is watch forisRunning === trueand prevent going to next.johnny-five/lib/animation.js
Lines 85 to 91 in 094bf6c
If we call
pauseright before, this is not working too because it doesn't turnrunningfalse.johnny-five/lib/animation.js
Lines 125 to 138 in 094bf6c
if we call
stopwe clear the stack because thisjohnny-five/lib/animation.js
Line 150 in 094bf6c
So we can't go to the next animation.
Only solution is to call
stopand trigger a new animation from within the callback.Second issue
oncompletecallback is not called for current animation when usingstop(). But it only callonStopMaybe we could think about something else ?