Search code examples
drag-and-dropcappuccinoobjective-j

Snap to Grid UI in Cappuccino


Does anyone know how to do snap-to-grid in Cappuccino? Basically, I have draggable objects which I can drag into a target area. The target view needs to be set up with snap-to-grid feature. I've seen it with Mockingbird, so it's definitely possible.

Any info is appreciated.

Thanks!


Solution

  • You'd probably implement a receiver for the draggingUpdated message and update the position of your drag feedback view to your snap positions. Apple's docs might help: draggingUpdated. Just think CP instead of NS.