(value, suppressEvents)
| 1245 | // } |
| 1246 | |
| 1247 | timeScale(value, suppressEvents) { |
| 1248 | if (!arguments.length) { |
| 1249 | return this._rts === -_tinyNum ? 0 : this._rts; // recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed. |
| 1250 | } |
| 1251 | if (this._rts === value) { |
| 1252 | return this; |
| 1253 | } |
| 1254 | let tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; // make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation. |
| 1255 | |
| 1256 | // future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called. |
| 1257 | //(+value < 0 && this._rts >= 0) && _callback(this, "onReverse", true); |
| 1258 | |
| 1259 | // prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes. |
| 1260 | this._rts = +value || 0; |
| 1261 | this._ts = (this._ps || value === -_tinyNum) ? 0 : this._rts; // _ts is the functional timeScale which would be 0 if the animation is paused. |
| 1262 | this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false); |
| 1263 | _setEnd(this); // if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here. |
| 1264 | return _recacheAncestors(this); |
| 1265 | } |
| 1266 | |
| 1267 | paused(value) { |
| 1268 | if (!arguments.length) { |
no test coverage detected