feat: make some shit more prettier

This commit is contained in:
2024-03-06 19:44:37 +01:00
parent 3512f4b8c4
commit c355d0c955
7 changed files with 77 additions and 28 deletions

View File

@@ -47,8 +47,12 @@
(event.clientY - mouseDownY) / cameraPosition[2];
if (event.ctrlKey) {
newX = snapToGrid(newX, 2.5);
newY = snapToGrid(newY, 2.5);
const targets = [1, 2, 4, 8];
const index = Math.floor(
((cameraPosition[2] - 4) / (150 - 4)) * targets.length * 0.999,
);
newX = snapToGrid(newX, 5 / targets[index]);
newY = snapToGrid(newY, 5 / targets[index]);
}
node.position.x = newX;
node.position.y = newY;