Skip to content

Commit 873ad4f

Browse files
committed
onLoop should be called before ResetTweenData
1 parent d8e0840 commit 873ad4f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

v3/src/tween/timeline/Timeline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ var Timeline = new Class({
302302
{
303303
if (this.loopCounter > 0)
304304
{
305-
this.resetTweens(true);
306-
307305
// Reset the elapsed time
308306
// TODO: Probably ought to be set to the remainder from elapsed - duration
309307
// as the tweens nearly always over-run by a few ms due to rAf
@@ -320,6 +318,8 @@ var Timeline = new Class({
320318
onLoop.func.apply(onLoop.scope, onLoop.params);
321319
}
322320

321+
this.resetTweens(true);
322+
323323
if (this.loopDelay > 0)
324324
{
325325
this.countdown = this.loopDelay;

v3/src/tween/tween/components/NextState.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ var NextState = function ()
44
{
55
if (this.loopCounter > 0)
66
{
7-
this.resetTweenData(true);
8-
97
this.elapsed = 0;
108
this.progress = 0;
119
this.loopCounter--;
@@ -19,6 +17,8 @@ var NextState = function ()
1917
onLoop.func.apply(onLoop.scope, onLoop.params);
2018
}
2119

20+
this.resetTweenData(true);
21+
2222
if (this.loopDelay > 0)
2323
{
2424
this.countdown = this.loopDelay;

0 commit comments

Comments
 (0)