"Break apart" path into multiple paths

42 views
Skip to first unread message

Dalton Spillman

unread,
Jun 26, 2021, 8:42:34 PM6/26/21
to skia-discuss
I'm working on a vector eraser tool for an app, and I have most of it working by performing a difference operation between the previously-drawn paths and the eraser's path.

I now need to take the path created by the difference operation and break it up into multiple paths based on areas that are separate from one another.

I have tried doing this by starting a new path at each Move verb, but that produces incorrect looking results when erasing the inside of a path: https://youtu.be/aNS8-WW1ZzM

Is there something built-in that will do this for me? Or do you have any ideas on how to do this?

Thank you 🙂

Dalton Spillman

unread,
Jul 2, 2021, 4:42:25 PM7/2/21
to skia-discuss
I figured out how to do this by drawing the broken-up paths and comparing the pixels... the algorithm is a little complicated, but it can be done that way.
Reply all
Reply to author
Forward
0 new messages