feat: Change grid size

This commit is contained in:
Panayiotis Lipiridis 2020-12-24 16:45:42 +02:00
parent 39e7b8cf4f
commit 40cd4caeec
10 changed files with 146 additions and 13 deletions

View file

@ -307,9 +307,10 @@ const doSegmentsIntersect = (p1: Point, q1: Point, p2: Point, q2: Point) => {
export const getGridPoint = (
x: number,
y: number,
gridSize: number | null,
isGridOn: boolean,
gridSize: number,
): [number, number] => {
if (gridSize) {
if (isGridOn) {
return [
Math.round(x / gridSize) * gridSize,
Math.round(y / gridSize) * gridSize,