I'm writing a drawing application. I want to draw a 2d spline and then test if the user has clicked on it. I know that finding the distance from an arbitrary point to a spline is complicated, but I just want to know if I'm within a couple of pixels. Is there a straightforward way to do this?
If its relevant, I'm using Cairo via the Gtk2Hs library in Haskell.