Hot Door CORE Forum

Full Version: Tool snapping and HitTests
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(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.
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. ;-)