Skip to content

Commit 6d17343

Browse files
committed
Looped Tween Timelines would mess-up the tween values on every loop repeat, causing the loop to fail. They now loop correctly due to a fix in the Tween.play method. Fix phaserjs#4558
1 parent bb27213 commit 6d17343

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ The following changes took place in the Pointer class:
183183
* Setting `random: false` in a Particle Emitter config option no longer causes it to think random is true (thanks @samme)
184184
* `Zone.setSize` didn't update the displayOrigin, causing touch events to be inaccurate as the origin was out. Fix #4131 (thanks @rexrainbow)
185185
* `Tween.restart` wouldn't restart the tween properly. Fix #4594 (thanks @NokFrt)
186+
* Looped Tween Timelines would mess-up the tween values on every loop repeat, causing the loop to fail. They now loop correctly due to a fix in the Tween.play method. Fix #4558 (thanks @peteroravec)
186187

187188
### Examples, Documentation and TypeScript
188189

src/tweens/Timeline.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,6 @@ var Timeline = new Class({
628628
if (this.loopCounter > 0)
629629
{
630630
// Reset the elapsed time
631-
// TODO: Probably ought to be set to the remainder from elapsed - duration
632-
// as the tweens nearly always over-run by a few ms due to rAf
633-
634631
this.elapsed = 0;
635632
this.progress = 0;
636633

src/tweens/tween/Tween.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ var Tween = new Class({
665665
{
666666
return this;
667667
}
668-
else if (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED)
668+
else if (!this.parentIsTimeline && (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED))
669669
{
670670
this.seek(0);
671671
this.parent.makeActive(this);

0 commit comments

Comments
 (0)