блочно > Сетка > alignXY
Метод Grid.alignXY()
Учитывая координату, верните ближайшую координату, выровненную по сетке.
Подпись:
alignXY(xy: Coordinate): Coordinate;
Параметры
Возврат:
Координировать
Координата рабочей области ближайшей точки сетки. Если изменений нет, верните тот же объект координат.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2024-11-13 UTC.
[null,null,["Последнее обновление: 2024-11-13 UTC."],[[["The `alignXY` method aligns a given workspace coordinate to the nearest grid point."],["It takes a `Coordinate` object as input, representing the workspace coordinate to be aligned."],["The method returns a `Coordinate` object representing the nearest grid point, potentially returning the original coordinate if no alignment is needed."]]],["The `alignXY` method, part of the Grid class, takes a workspace coordinate (`xy`) as input. It calculates and returns the nearest coordinate that aligns with the grid. If the input coordinate is already aligned, the same coordinate object is returned. The method's signature is `alignXY(xy: Coordinate): Coordinate;`, accepting a Coordinate type and returning a Coordinate type. The core action is finding and returning the grid-aligned coordinate.\n"]]