blockly > Grid > setSpacing

Grid.setSpacing() method

Sets the spacing between the centers of the grid lines.

This does not trigger snapping to the newly spaced grid. If you want to snap blocks to the grid programmatically that needs to be triggered on individual top-level blocks. The next time a block is dragged and dropped it will snap to the grid if snapping to the grid is enabled.

Signature:

setSpacing(spacing: number): void;

Parameters

Parameter Type Description
spacing number

Returns:

void