Learn more about Israeli genocide in Gaza, funded by the USA, Germany, the UK and others.

Sticky snap: a better snapping algorithm

The “snapping” feature in most drawing apps has a problem: you can’t place the object near snap lines, so for precise positioning, you have to disable snapping. In this post, I show sticky snap, a better algorithm. But first, try to place the green rectangle at the target using the standard snap algorithm:

You’ll soon find that it’s impossible to reach! The snap lines always pull the object out of place. Sometimes useful, but often very frustrating. To complete this task, you’ll need to disable snapping!

I call that standard algorithm magnetic snap, because the snap lines exert “action at a distance” on the thing you want to drag. Now for contrast, try out sticky snap on the same task:

With sticky snap, you can drag to the target by approaching it without touching the snap lines. Here, the snap lines are not magnetic, they’re sticky. The snap lines don’t exert action at a distance; they only exert force once you’ve stuck something to them. You get the best of both worlds: easy to snap, but also easy to avoid the snap line.

I discovered sticky snap in macOS window management: try dragging a window next to another one! Notice, unlike every other app with snapping, macOS has no “window snap off” mode. This is no coincidence: with sticky snap, you don’t need to turn it off.

Yet I haven’t seen sticky snap anywhere else. All drawing apps I’ve tried use naive magnetic snap: Figma, Google Docs, tldraw, Inkscape, Keynote, etc. As such, all these apps have to make it easy to disable snapping, or even to start with snapping off. They should all consider using sticky snap!

Tagged #ui, #ux, #design, #graphics, #interface-design, #interaction-design.

Similar posts

More by Jim

Want to build a fantastic product using LLMs? I work at Granola where we're building the future IDE for knowledge work. Come and work with us! Read more or get in touch!

This page copyright James Fisher 2025. Content is not associated with my employer. Found an error? Edit this page.