From d4ef61abe3c6fed50a6781b4dcb9e40b1a54ad6d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 2 Apr 2026 22:16:09 +0200 Subject: [PATCH] Snap box brush size to grid in ViewportHost --- src/viewport-three/viewport-host.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 7b71d166..74b69f04 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -1490,18 +1490,18 @@ export class ViewportHost { case "top": return { x: snapValueToGrid(this.boxCreateIntersection.x, DEFAULT_GRID_SIZE), - y: DEFAULT_BOX_BRUSH_SIZE.y * 0.5, + y: snapValueToGrid(DEFAULT_BOX_BRUSH_SIZE.y * 0.5, DEFAULT_GRID_SIZE), z: snapValueToGrid(this.boxCreateIntersection.z, DEFAULT_GRID_SIZE) }; case "front": return { x: snapValueToGrid(this.boxCreateIntersection.x, DEFAULT_GRID_SIZE), y: snapValueToGrid(this.boxCreateIntersection.y, DEFAULT_GRID_SIZE), - z: DEFAULT_BOX_BRUSH_SIZE.z * 0.5 + z: snapValueToGrid(DEFAULT_BOX_BRUSH_SIZE.z * 0.5, DEFAULT_GRID_SIZE) }; case "side": return { - x: DEFAULT_BOX_BRUSH_SIZE.x * 0.5, + x: snapValueToGrid(DEFAULT_BOX_BRUSH_SIZE.x * 0.5, DEFAULT_GRID_SIZE), y: snapValueToGrid(this.boxCreateIntersection.y, DEFAULT_GRID_SIZE), z: snapValueToGrid(this.boxCreateIntersection.z, DEFAULT_GRID_SIZE) };