Timeline.setTimeScale would only impact the Timeline loop and completion delays, not the actively running Tweens. It now scales the time for all child tweens as well. Fix #4164

This commit is contained in:
Richard Davey 2019-06-19 12:34:41 +01:00
parent 6d173434eb
commit ae591c1c34
2 changed files with 4 additions and 4 deletions

View file

@ -184,6 +184,7 @@ The following changes took place in the Pointer class:
* `Zone.setSize` didn't update the displayOrigin, causing touch events to be inaccurate as the origin was out. Fix #4131 (thanks @rexrainbow)
* `Tween.restart` wouldn't restart the tween properly. Fix #4594 (thanks @NokFrt)
* 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)
* `Timeline.setTimeScale` would only impact the Timeline loop and completion delays, not the actively running Tweens. It now scales the time for all child tweens as well. Fix #4164 (thanks @garethwhittaker)
### Examples, Documentation and TypeScript

View file

@ -14,7 +14,8 @@ var TWEEN_CONST = require('./tween/const');
* @classdesc
* A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween.
*
* The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline.
* The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence
* of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline.
*
* @class Timeline
* @memberof Phaser.Tweens
@ -695,8 +696,6 @@ var Timeline = new Class({
return;
}
var rawDelta = delta;
if (this.useFrames)
{
delta = 1 * this.manager.timeScale;
@ -720,7 +719,7 @@ var Timeline = new Class({
{
var tween = this.data[i];
if (tween.update(timestamp, rawDelta))
if (tween.update(timestamp, delta))
{
stillRunning--;
}