Hot Door CORE Forum
Tool snapping and HitTests - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: General discussion (http://hotdoorcore.com/forum/forumdisplay.php?fid=3)
+--- Thread: Tool snapping and HitTests (/showthread.php?tid=95)



Tool snapping and HitTests - Rick Johnson - 08-23-2016

In the Plugin class, when we enable tool snapping to art, is there a certain number of points or pixels (which varies with zoom level) before it snaps? Or is this picked up from the user preferences?

I'm finalizing a plugin that drills down through multiple layers of objects at a particular point, and am looking for a balance of user-friendly (most I'm sure are using high-res monitors with medium-res tablets) so snap-to-art helps! If my follow-up HitTests are too broad, I get multiple hits on the same path. If it's too small, it often misses close-by paths altogether. At this point I'm pretty sure the best compromise is to allow users to set sensitivity settings, which translate into HitData.tolerance_.

Is there some setting or approach I may be overlooking?

BTW, PathArt.getIntersections is awesome!

Thanks -- rj


RE: Tool snapping and HitTests - garrett - 08-30-2016

(08-23-2016, 06:21 PM)Rick Johnson Wrote: In the Plugin class, when we enable tool snapping to art, is there a certain number of points or pixels (which varies with zoom level) before it snaps? Or is this picked up from the user preferences?

Yes, there is a user-adjustable Illustrator preference for the smart guides tolerance.


RE: Tool snapping and HitTests - Rick Johnson - 09-01-2016

Thanks, Garrett, I didn't make the connection between "snapping" and "smart guides." I don't want my plugins to rely on smart guides being enabled, but want to help users find paths, points, and intersections easier, even if they're a little shaky or their tablets are relatively small compared to their monitor resolution (I suspect this is a pretty common situation) so I'll study the headers some more and be governed accordingly. ;-)