I have an application I'm trying to develop that has an interface much like a windows desktop, in which a user can drag icons to any position on the container, and the icons will stay there. Right now a user could stack icons by dragging one onto another one, but I don't want them to be able to do that: users should only be able to drag icons to places that don't collide with other icons.
I thought that maybe I could try to select an element in the given position in a draggable callback function, and see if any elems were selected, but I know box collision is a solved problem, and I basically just want my box being dragged to only move if no collision has taken place. What's the best way to do that?