Skip to content

Is it possible to call onTouchHandler in a child component #630

Answered by chrfalch
ronickg asked this question in Q&A
Discussion options

You must be logged in to vote

The "problem" with touch handling in Skia is that there are no React components inside a Skia Canvas - only a declaration of the drawing you want Skia to perform.

This means that there is no way for React, Skia or any of us to automatically know the position and size of a "component" you write inside of the Canvas - what if you added a complex path that are drawn in Skia? There would be no way to quickly detect if a touch was on this Path or outside of it.

Our suggestion is that you create a way to detect if your brush component is touched when the Canvas' onTouch handler is called.

This is unfortunately not the solution you're after, and this has been brought up before in our issues list…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ronickg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants