Clever. I'll have to benchmark to see which method is faster. Since I'll be doing this check hundreds of times in a loop every frame it's probably speed critical.
ADDITION: Actually, the distance way works better because it has an easily controlled threshold value (line_thickness.) With the slopes method I was needing to click exactly on the line. I thought of a way to do a threshold but that would have been a pain and probably pretty slow.
ADDITION: Actually, the distance way works better because it has an easily controlled threshold value (line_thickness.) With the slopes method I was needing to click exactly on the line. I thought of a way to do a threshold but that would have been a pain and probably pretty slow.