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 am trying to save an SVG export by writing in the end of draw():
if(mouseIsPressed&&!isSvgSaved){console.log("saving svg");save("mySVG.svg");// give file nameprint("saved svg");isSvgSaved=true;}
This works very well simple elements, but now I try to save a project, where I use
letpixelColor=get(x,y)
It breaks the code, I get this error:
index.html:172 Uncaught Error: svgcanvas: options.async must be set to true for getImageData
at ImageUtils.getImageData (index.html:172:23)
at Context.getImageData (index.html:1501:26)
at d.default.Renderer2D._getPixel (p5.min.js:3:448164)
at l.default.Renderer.get (p5.min.js:3:437733)
at h.default.get (p5.min.js:3:573138)
at draw (sketch.js:56:25)
at o.default.redraw (p5.min.js:3:487659)
at _draw (p5.min.js:3:424542)
I tried to solve it, even by copying your whole script into index.html and enforcing options.async = true everywhere, but neither worked.
The text was updated successfully, but these errors were encountered:
I am trying to save an SVG export by writing in the end of draw():
This works very well simple elements, but now I try to save a project, where I use
It breaks the code, I get this error:
I tried to solve it, even by copying your whole script into index.html and enforcing
options.async = true
everywhere, but neither worked.The text was updated successfully, but these errors were encountered: