You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started playing with some simple sketches and noticed a huge slowdown after a few seconds of use.
Saving the SVG and opening it in Illustrator, I noticed there was a huge number of nested nodes. It seems every call of p5.js' draw method adds a new g node as a child of the already existing g node inside the svg element created by p5.js-svg. In other words, every frame gets added to the DOM, although only the last one is visible.
A quick workaround is calling the __clearCanvas method of the Context at the beginning of p5.js' draw:
let renderer;
setup() {
renderer = createCanvas(100, 100, SVG);
}
draw() {
renderer.drawingContext.__clearCanvas();
// Do the drawing
}
No description provided.
The text was updated successfully, but these errors were encountered: