Path contains mouse position


#1

Hi,
Is there any method/api or technique one can use, to determine if a point (such as a mouse position) lies on or near a path, such as a non-closed path as a line, or an arrow?

I understand there is Path::contains but it refers to closed paths and I need to pinpoint a wavy line.

I’d appreciate anything!

/Michael


#2

Just turn the path into a stroke, and then see if the point is inside that.


#3

I’m sorry, but how do I do that? Is “stroke” a class… or what? The only reference to strokes is in Graphics.strokePath
Am I missing something?


#4

Use the PathStrokeType class.


#5

Very nice. Works great. Thank you!