Closed ShaMan123 closed 5 years ago
@ShaMan123 Check out my (movable, rotatable and scalable) shapes branch on my fork. It's only working on android for now (check example 1 of the example app), but starting on the iOS part soon.
It's mostly done in native but we could move some of the logic to the JS-side in the end which would help us both :-).
Aside from that, try to work with an offset (hitslop) so you can detect even when the user slightly misses the line.
@creambyemute it says your branch is even with master. I've implemented a rough android touch detector in my fork. Not entirely happy with it because it detects a general touch on a path in the canvas. It doesn't detect a certain path unfortunately. Tried other methods to achieve this with no luck. Have no experience writing in iOS but found some documentation regarding path touch deection. I will soon start working on it.
@ShaMan123 thats why I said to look at my branch :P. I didn't work on master but on a separate branch
changed issue title and method to isPointOnPath(x, y, pathId, callback)
closing. see PR #99
I'm using
SketchCanvas
in 2 ways:if
touchEnabled === true
=> the user paints iftouchEnabled === false
=> the user touchesSketchCanvas
in order to pick a path.This is why I'm trying to detect if a user touches a path while
touchEnabled
prop is set tofalse
. Is there a way?Managed to write a function that returns the
pathId
of a touched path. However it doesn't work properly because of the inaccuracy of the touch and because of thewidth
of the path. Any idea how to detect a touch made on a path that is not exactly on a given point of the path.I'm clueless regarding native code :(