MCPcopy Index your code
hub / github.com/KilledByAPixel/LittleJS / loopContinuation

Function loopContinuation

plugins/tweenSystem.js:439–448  ·  view source on GitHub ↗
(tween)

Source from the content-addressed store, hash-verified

437// from `.loop()` keeps working — calling `.stop()` mid-loop now cancels
438// the entire chain instead of just the current iteration.
439function loopContinuation(tween)
440{
441 if (tween.loopRemaining !== Infinity && tween.loopRemaining <= 1) return;
442 if (tween.loopRemaining !== Infinity) tween.loopRemaining -= 1;
443 tween.life = tween.duration;
444 tween.thenCallback = () => loopContinuation(tween);
445 tweenActive.push(tween);
446 // snap to start for the new iteration (matches Tween constructor behavior)
447 tween.callback(tween.interp(tween.duration));
448}
449
450// Continuation for pingPong: swaps start and end on the same tween each iteration.
451function pingPongContinuation(tween)

Callers 1

loopMethod · 0.85

Calls 1

interpMethod · 0.80

Tested by

no test coverage detected