Skip to main content

Module settle

Module settle 

Source
Expand description

Turns transient rectangle geometry into a valid resting layout.

Direct manipulation is deliberately unconstrained: a rectangle in a user’s hand may pass through, or temporarily cover, anything. The boundary here is the other side of that gesture. Given the frames the gesture asked for, this module keeps the resting layout anchored and relocates the frames the gesture moved to their nearest clear landing.

The application decides when a gesture has ended and which ids express its intent. This module knows only opaque ids, rectangles, a grid and a gap.

Functions§

clash
Whether two rectangles come closer to one another than gap.
settled
Settles frames into a layout in which no pair comes closer than gap.