Skip to main content

blockly > Grid > alignXY

Grid.alignXY() method

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

Signature:

alignXY(xy: Coordinate): Coordinate;

Parameters

Parameter

Type

Description

xy

Coordinate

A workspace coordinate.

Returns:

Coordinate

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