How to Implement an Eraser Using PathOp in React Native Skia? #3054
satishg123
started this conversation in
General
Replies: 1 comment
-
My approach to eraser is way different to yours, I just redraw the base layer, for instance if it's a white background you just draw a white stroke, if it's an image you use your stroke along with a mask. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing an eraser in my React Native Skia project by calculating the bounds of the eraser path and using Skia.Path.op() with the Difference method to subtract from the existing path. However, instead of properly subtracting, it breaks the path into multiple closed shapes. I was expecting it to erase parts of the stroke while keeping the remaining path intact.
Does Skia.Path.op() work only with closed paths? If so, is there a recommended approach for erasing strokes? Should I manually close the paths before applying op()?
Beta Was this translation helpful? Give feedback.
All reactions