MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / idle

Method idle

modules/drivers/neostrand/neostrand.js:68–91  ·  view source on GitHub ↗
(effect, ticks)

Source from the content-addressed store, hash-verified

66 }
67
68 idle(effect, ticks) {
69 if (ticks > (effect.lastTickle + effect.tickle)) {
70 effect.lastTickle = ticks;
71 if (effect.reverse == 1)
72 effect.time = effect.duration - ((ticks - effect.startTicks) % effect.duration);
73 else
74 effect.time = ticks - effect.startTicks;
75
76 if (effect.time > effect.duration) {
77//@ maybe loop == -1 is back and forth
78 if (effect.loop) {
79 effect.loopPrepare(effect);
80 effect.startTicks = ticks;
81 effect.time = effect.time % effect.duration;
82 effect.timeline.seekTo(effect.time);
83 }
84 else if (undefined !== effect.onComplete)
85 effect.onComplete(effect);
86 }
87 else {
88 effect.timeline.seekTo(effect.time);
89 }
90 }
91 }
92
93}
94

Callers 2

startMethod · 0.80

Calls 3

onCompleteMethod · 0.80
loopPrepareMethod · 0.45
seekToMethod · 0.45

Tested by

no test coverage detected