Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/image/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ p5.prototype.saveGif = async function(
// stop the loop since we are going to manually redraw
this.noLoop();

// Defer execution until the rest of the call stack finishes, allowing the
// rest of `setup` to be called (and, importantly, canvases hidden in setup
// to be unhidden.)
//
// Waiting on this empty promise means we'll continue as soon as setup
// finishes without waiting for another frame.
await Promise.resolve();

while (frameIterator < totalNumberOfFrames) {
/*
we draw the next frame. this is important, since
Expand Down