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

is there a way to erase the brushes via EraserBrush? #7

Open
matthewsibigtroth opened this issue Aug 20, 2021 · 3 comments
Open

is there a way to erase the brushes via EraserBrush? #7

matthewsibigtroth opened this issue Aug 20, 2021 · 3 comments

Comments

@matthewsibigtroth
Copy link

Incredible library!! So good.

Was curious if folks have found a way to erase these brushes via the EraserBrush?

When I flip to the EraserBrush, it wholesale erases everything which makes me think that the line parts are being clumped into one group that is being deleted, rather than deleting its sub components.

Thank you for any insights you may have!

@matthewsibigtroth
Copy link
Author

And actually following up on that, I wonder if an older version of fabric.js is EraserBrush-compatible with fabric-brush? Like perhaps at one time erasing played well with fabric-brush?

@arunshourie
Copy link

arunshourie commented Apr 14, 2022

Wonderful Library! - wondering if you've found any @matthewsibigtroth alternative/solution to eraser brush. It would be great.

Don't want to move away from this library for the lack of this one particular eraser functionality

@matthewsibigtroth
Copy link
Author

matthewsibigtroth commented Apr 14, 2022

It's been awhile, but if I recall, I was unable to solve the erasing issue.

I ended up moving to a more native approach, where I would draw a tiny image to the canvas on mouse move as demonstrated in the "brush, fur, pen" section (see here for more info).

To erase in this methodology, I used the canvas "globalCompositeOperation" attribute to toggle erasing on and off (see here for more info).

I didn't try, but it also makes me wonder if one would be able to dig into the fabric brush libs and see if at a lower level this sort of erasing could be integrated (assuming it is using canvas)?

Hope that helps!!

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

2 participants