antfu / drauu

Headless SVG-based drawboard in browser.
https://drauu.netlify.app/
MIT License
1.2k stars 64 forks source link

No eraser 😔 #5

Open thecodrr opened 3 years ago

thecodrr commented 3 years ago

Hey, I found this epic project though Changelog Daily Newsletter and it's wow! The speed and the agility of this is on another level.

But it doesn't have an eraser. Any plans to support that? Or can you give some tips on how someone would go around adding such a support? 😱

antfu commented 3 years ago

Yes, we do plan to have that. Giving it's actually a bit complex, it could take some time to make it works well. Unfortunately I don't have bandwidth to work on it yet, before that, contributions are great welcome!

Dunqing commented 3 years ago

maybe can consider supporting the feature to remove SVG child elements?

unimplode commented 3 years ago

Drauu is amazing! Thank you. I agree with the need for eraser. I've used many drawing apps (as a professional animator) and created some myself - I have found that an incredibly useful tool is one that deletes any stroke it touches. It encourages redrawing a line instead of fixing it - resulting in more natural gestural strokes. Perhaps this is similar or same to what 1247748612 is suggesting. It is different than an eraser and I believe easier to implement. In another app that i developed I would store the bounding box info with every stroke - then to detect collisions later I only have to go through point lists if the cursor is already in the bounding box of a stroke. A feature like this is also a very good reason to use svg over say, canvas.

thecodrr commented 3 years ago

@unimplode path deletion is relatively easier than path manipulation via difference. That should be the first step I suppose. Would be cool to add path selection somehow.