* Restarts an animated GIF at its first frame. * * @example * let gif; * * async function setup() { * // Load the image. * gif = await loadImage('assets/arnott-wallace-wink-loop-once.gif'); * * createCanvas(100, 100); * * describe('A cartoon face winks once a
()
| 1512 | * } |
| 1513 | */ |
| 1514 | reset() { |
| 1515 | if (this.gifProperties) { |
| 1516 | const props = this.gifProperties; |
| 1517 | props.playing = true; |
| 1518 | props.timeSinceStart = 0; |
| 1519 | props.timeDisplayed = 0; |
| 1520 | props.lastChangeTime = 0; |
| 1521 | props.loopCount = 0; |
| 1522 | props.displayIndex = 0; |
| 1523 | this.drawingContext.putImageData(props.frames[0].image, 0, 0); |
| 1524 | } |
| 1525 | } |
| 1526 | |
| 1527 | /** |
| 1528 | * Gets the index of the current frame in an animated GIF. |
no outgoing calls
no test coverage detected