-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setAttributes() invalidates references to earlier canvases #5902
Comments
Was able to reproduce the issue. When See code:
Calling In the meantime, the safest method is to always refer to the renderer from its internal pointer |
A fix might require a slight redesign of what gets returned by |
hello @davepagurek this seems interesting too ! Could you explain this or maybe elaborate on what needs to be done here -_- Thank You |
@davepagurek Should i start working on this? |
@Artimus100 feel free to start looking into it, but this one probably could use some discussion here in the issue once you have an idea of how to solve it before making a PR. The problem under the hood is that the canvas created by I mentioned in a comment that one way to address the issue is, rather than directly returning the renderer from |
@Artimus100 , @davepagurek can I take this up ? I would love to look into this. |
Thanks @Forchapeatl! Let me know if you have any ideas on approaches to take here. |
Most appropriate sub-area of p5.js?
p5.js version
1.5.0
Web browser and version
107.0.1
Operating System
macOS 12.5.1
Steps to reproduce this
Calling
setAttributes
in WebGL mode might end up recreating the underlying canvas and renderer object.Say you're trying to position the element, e.g. like this:
Unfortunately, this stops working after a
setAttributes
call, because after that call,canvas !== _renderer
. Currently, to fix it, one would have to do:The text was updated successfully, but these errors were encountered: