(time)
| 62 | return new Tween(target, properties, duration, easing, delay); |
| 63 | } |
| 64 | seekTo(time) { |
| 65 | let duration = this.duration; |
| 66 | time -= this.delay; |
| 67 | if (time < 0) |
| 68 | time = 0; |
| 69 | else if (time > duration) |
| 70 | time = duration; |
| 71 | if (this.time !== time) { |
| 72 | this.time = time; |
| 73 | let target = this.target; |
| 74 | let fraction = time / duration; |
| 75 | let easing = this.easing; |
| 76 | if (easing) |
| 77 | fraction = easing.call(Math, fraction); |
| 78 | let properties = this.properties; |
| 79 | let c = properties.length; |
| 80 | for (let i = 0; i < c; i++) |
| 81 | properties[i].tween(target, fraction) |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | export default class Timeline { |
no test coverage detected