Draggable: Account for margins when snapping

Fixes #9724