← Back to Docs
  • index.html
  • Clayground
  • Clayground.Lab
  • GridMode
  • Clayground 2026.7
  • GridMode QML Type

    Snap-or-free placement, with grafli's grid contract. More...

    Import Statement: import Clayground.Lab

    Properties

    Methods

    Detailed Description

    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:

    GridMode { id: grid }
    // ... in a drag handler:
    root.moveElement(id, col, row, grid.snapping(mouse.modifiers))

    See also LabKeys.

    Property Documentation

    snap : bool

    Snapping to the raster.


    step : real

    Raster spacing in world units.


    Method Documentation

    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()