Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/image/p5.Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -1807,6 +1807,7 @@ p5.Image = class {
props.lastChangeTime = 0;
props.displayIndex = index;
this.drawingContext.putImageData(props.frames[index].image, 0, 0);
this.setModified(true);
} else {
console.log(
'Cannot set GIF to a frame number that is higher than total number of frames or below zero.'
Expand Down
4 changes: 4 additions & 0 deletions src/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,10 @@ p5.RendererGL = class RendererGL extends p5.Renderer {

const texture = this.textures.get(src);
if (texture) {
if (src.isModified()) { // Assuming isModified() returns the _modified flag
texture.update(src); // Update texture with new image data
src.setModified(false); // Reset the modified flag
}
return texture;
}

Expand Down