Fbada006 / ArtMaker

ArtMaker is a flexible and customisable library that allows users to draw anything they want on screen and has been built fully with Jetpack Compose.
75 stars 3 forks source link

Erasing Logic #82

Closed emmanuelmuturia closed 2 months ago

emmanuelmuturia commented 3 months ago
emmanuelmuturia commented 3 months ago

@CalebKL This is noted. Could you please point me to the right resources for Erasing on Canvas? I have searched for it and only got references to BlendMode which was clearing the whole drawing at once instead of continuously erasing the drawing.

Also, will the Erase Circle be displayed upon touch either by finger or stylus? Will we also have to configure its size?

CalebKL commented 3 months ago

@CalebKL This is noted. Could you please point me to the right resources for Erasing on Canvas? I have searched for it and only got references to BlendMode which was clearing the whole drawing at once instead of continuously erasing the drawing.

Also, will the Erase Circle be displayed upon touch either by finger or stylus? Will we also have to configure its size?

_pathList is mutable, so if we can add points data to it, it means, we can also remove data from it. Thats what I was thinking, Maybe try this and let me know if it would work.

CalebKL commented 3 months ago

@emmanuelmuturia I have tried running the app and its not rubbing any points, did you check if it was working? Its actually drawing new points instead of rubbing.

emmanuelmuturia commented 3 months ago

@emmanuelmuturia I have tried running the app and its not rubbing any points, did you check if it was working? Its actually drawing new points instead of rubbing.

The implementation still needs refining as I am redrawing the pathlist points that are not close to the Eraser radius. I tried removing the _pathList points as you suggested but the issue I was encountering was that the entire drawing was being removed instead of the individual points. What do you think I could do to improve my current implementation? Here is my current implementation's demo to confirm that my latest changes were working on my end:

Erase.webm

emmanuelmuturia commented 3 months ago

@CalebKL Please let me know if it works now and what could be refined in my latest changes...

Fbada006 commented 2 months ago

Closing this in favour of https://github.com/Fbada006/ArtMaker/pull/84