a solution for detecting a tap on a path

I ignored the lineCap, lineJoin, and miterLimit because I don't think they'd really matter. Other ideas are in the comments for future reference.