VL Skia path hittest

Is there a recommended way to do a hittest/intersection test for a skia path?

2 Likes

Hi TobyK,

you can create a very small simple path (like Rectangle) and do the Paths > Op (path Operation: Intersect) between your path and this small rect path (for example attached to mouse position). Then you can check if the resulting path is empty or not: Paths > IsEmpty.

This is a general approach which works in many scenarios.

Skia has also Contains, which takes a path and a point (XY). But this one is missing in VL.Skia for the moment. We’ll add it soon.

Best,
Anton

1 Like

Thanks, will try it

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.