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
First off thanks so much for this wonderful library! It helped me out a lot for a project! This is not an issue per se, but I was stuck for a while on some behaviour that took me quite a while to wrap my head around it.
When using a graphics buffer in the regular P5 runtime, there's generally no need to call the background() function or clear the canvas when the graphics buffer takes up the entire size of the canvas and is drawn over it with image(buffer, 0, 0, windowWidth, windowHeight).
The graphics buffer needs to essentially be instantiated like this createGraphics(buffer_size, buffer_size, SVG) same is not true for the SVG runtime, it will simply keep adding the graphics buffer over and over again as a new, nested SVG, slowly increasing the size.
This can be solved in two ways, either by calling background() which clears the canvas, or renderer.drawingContext.__clearCanvas() before redrawing the graphics buffer. This is fine, but it might be nice to have a little note about that behaviour somewhere.
The text was updated successfully, but these errors were encountered:
First off thanks so much for this wonderful library! It helped me out a lot for a project! This is not an issue per se, but I was stuck for a while on some behaviour that took me quite a while to wrap my head around it.
When using a graphics buffer in the regular P5 runtime, there's generally no need to call the background() function or clear the canvas when the graphics buffer takes up the entire size of the canvas and is drawn over it with
image(buffer, 0, 0, windowWidth, windowHeight)
.The graphics buffer needs to essentially be instantiated like this
createGraphics(buffer_size, buffer_size, SVG)
same is not true for the SVG runtime, it will simply keep adding the graphics buffer over and over again as a new, nested SVG, slowly increasing the size.This can be solved in two ways, either by calling
background()
which clears the canvas, orrenderer.drawingContext.__clearCanvas()
before redrawing the graphics buffer. This is fine, but it might be nice to have a little note about that behaviour somewhere.The text was updated successfully, but these errors were encountered: