mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Change grid size
This commit is contained in:
parent
39e7b8cf4f
commit
40cd4caeec
10 changed files with 146 additions and 13 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue