Skip to content

Conversation

@CyrusCastle
Copy link

Hi, I really appreciate this little library, I'm currently using it in a KMP project of mine working with Farsi handwriting. I needed a way to actively enable/disable DrawController based on certain conditions, and to show the user a hint of how to draw the particular character they're working with.

Hence this PR.

I thought it'd be helpful if I implemented the eraser tool for you while I was there ^^

Changes:

  1. Bump to 1.4.0
  2. Implement the eraser tool (currently based on the points that make up the paths, rather than the paths themselves, which is not 100% reliable but works reliably enough - doing it based on whether paths intersect may become a tad inefficient especially with more complex drawings)
  3. Add an attribute to DrawController called enabled, default true, allows us to enable/disable input processing as wanted
  4. Added an optional content argument to DrawBox (backgroundContent: (@ Composable BoxScope.() -> Unit)? = null), this allows us to put some BoxScope content between the background colour and the foreground drawing. In my usecase, this allows us to put a piece of text for the user to trace
  5. Fixed onTap... because onTap was just making one point, the paths weren't appearing to the user, so place two points in the same place

@MarkYav
Copy link
Owner

MarkYav commented Jan 9, 2026

Hello @CyrusCastle! Happy to hear that the library was useful for you.

I will check the PR and update the release. Just to set expectations, my availability is limited right now, so this process will realistically take some time.

I really liked your idea about passing a composable function as a parameter! It is a more general approach, allowing more flexibility for future users. I am thinking about using this approach instead of sealed interface DrawBoxBackground, so as not to make several "layers".

The idea of enabling/disabling input processing is also interesting. And thank you for fixing onTap.

@MarkYav MarkYav self-assigned this Jan 9, 2026
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

Successfully merging this pull request may close these issues.

2 participants