REmoving snapSizeToGrid

This commit is contained in:
Yaro Kasear 2025-12-12 12:13:25 -06:00
parent 0b85715c1e
commit 1926a3930d

View file

@ -267,7 +267,6 @@ function applyGridSize(newSize) {
if (!Number.isFinite(n) || n < 1) return; if (!Number.isFinite(n) || n < 1) return;
gridSize = n; gridSize = n;
snapSizeToGrid();
dotSize = Math.floor(Math.max(gridSize * 1.25, 32)); dotSize = Math.floor(Math.max(gridSize * 1.25, 32));
@ -308,20 +307,6 @@ function setActiveType(typeId) {
} }
} }
function snapSizeToGrid() {
const grid = gridSize;
const rect = gridEl.getBoundingClientRect();
const targetW = rect.width;
const targetH = rect.height;
const snappedW = Math.floor(targetW / grid) * grid + 1;
const snappedH = Math.floor(targetH / grid) * grid + 1;
gridEl.style.width = `${snappedW}px`;
gridEl.style.height = `${snappedH}px`;
}
function snapToGrid(x, y) { function snapToGrid(x, y) {
/* /*
For portability, we do not allow pixel coordinates in the data model For portability, we do not allow pixel coordinates in the data model
@ -400,7 +385,6 @@ function normalizeLine(shape) {
} }
function resizeAndSetupCanvas() { function resizeAndSetupCanvas() {
snapSizeToGrid();
dpr = window.devicePixelRatio || 1; dpr = window.devicePixelRatio || 1;
const rect = canvasEl.getBoundingClientRect(); const rect = canvasEl.getBoundingClientRect();