Snap-or-free placement, with grafli's grid contract. More...
| Import Statement: | import Clayground.Lab |
Small on purpose: the value is not the code, it is that every lab that places things behaves identically, and identically to grafli. The contract:
# cycles the mode (LabKeys reserves the key).Alt inverts the mode for the length of one drag - grafli has no such modifier, this is the labs' addition, and it is the reason snapping() takes the event's modifiers rather than reading snap.GridMode { id: grid }
// ... in a drag handler:
root.moveElement(id, col, row, grid.snapping(mouse.modifiers))
See also LabKeys.
snap : bool |
Snapping to the raster.
step : real |
Raster spacing in world units.
real quantize(real v, int modifiers) |
Rounds v to the raster when this gesture snaps.
bool snapping(int modifiers) |
The mode for THIS gesture: snap, inverted while Alt is held.
void toggle() |