Skip to content
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

<canvas> domElements created when using the library #40

Open
double-hash opened this issue Jan 13, 2025 · 0 comments
Open

<canvas> domElements created when using the library #40

double-hash opened this issue Jan 13, 2025 · 0 comments

Comments

@double-hash
Copy link

double-hash commented Jan 13, 2025

Hi,

I have 2 problems, one minor and one more important

  • The first, and minor problem is :

I stated than when I use p5.brush.js, in my case, there is 3 "canvas" elements added to the DOM, at the end of my "body" tag.

{939CB766-B57D-4EF8-8009-2E381CBEABE9}

I think it's because how p5.Graphics Object works, but may be adding noCanvas() to the "p5.Graphics" Objects created in p5.brush may help ? I don't really know...

  • The second problem is :

I don't know if we can manipulate these p5.Graphics objects created in p5.brush.js, but it can be useful if we want to resize it for responsive purpose, for example.
Because, sometimes, when I zoom out, I can see some brushes being like masked by the boundaries of my initial resolution (the resolution when I ran my p5.js + p5.brush.js sketch). Actually, the canvases added like explained in my first point doesn't seems to be responsive, because if I resize my window or zoom out we can see this :

{FF8E6811-21AE-44E7-B384-6C6FC76F4889}

Note how my main "canvas" resolution change, and the resolution of the other and hidden canvases doesn't.

If you want to see visually what I'm trying to explain, here is the render of my canvas, after I zoom out:
{21F1BAA8-92EC-4DEF-A06D-43F4328F52B7}
The expected behavior is to not having this delimitation or boundary visible when I zoom out.
Note that the gap doesn't seem to happen with the "marker" brush.

I don't really know well yet how p5.brush.js is working, so I cannot help more by suggesting a change or submitting a pull request. But if you have some advices, or details for this behavior, I can try to check in details.

Thanks for your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant