Skip to main content

Module snap

Module snap 

Expand description

Snapping: what is dragged lands on the edges and centres of other boxes, and a guide shows what it lined up with.

Structs§

Guide
A line something snapped to: x = at from y = from to to when vertical, else y = at from x = from to to.
Snap
How far to shift what is dragged, and the guides it then lines up with.

Functions§

snap_point
Snap one point (a corner being dragged, a new shape’s corner) onto targets’ edges and centres.
snap_rect
Snap a box being moved onto targets’ edges and centres, each axis on its own, within tolerance units.