Skip to main content

Home > blockly > Grid > alignXY

Grid.alignXY() method

Given a coordinate, return the nearest coordinate aligned to the grid.

Signature:

alignXY(xy: Coordinate): Coordinate;

Parameters

ParameterTypeDescription
xyCoordinateA workspace coordinate.

Returns:

Coordinate

Workspace coordinate of nearest grid point. If there's no change, return the same coordinate object.