| 49 | } |
| 50 | |
| 51 | update(cfg, to, date) { |
| 52 | if (this._active) { |
| 53 | this._notify(false); |
| 54 | |
| 55 | const currentValue = this._target[this._prop]; |
| 56 | const elapsed = date - this._start; |
| 57 | const remain = this._duration - elapsed; |
| 58 | this._start = date; |
| 59 | this._duration = Math.floor(Math.max(remain, cfg.duration)); |
| 60 | this._total += elapsed; |
| 61 | this._loop = !!cfg.loop; |
| 62 | this._to = resolve([cfg.to, to, currentValue, cfg.from]); |
| 63 | this._from = resolve([cfg.from, currentValue, to]); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | cancel() { |
| 68 | if (this._active) { |