Snap box brush size to grid in ViewportHost

This commit is contained in:
2026-04-02 22:16:09 +02:00
parent 927839243f
commit d4ef61abe3

View File

@@ -1490,18 +1490,18 @@ export class ViewportHost {
case "top": case "top":
return { return {
x: snapValueToGrid(this.boxCreateIntersection.x, DEFAULT_GRID_SIZE), 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) z: snapValueToGrid(this.boxCreateIntersection.z, DEFAULT_GRID_SIZE)
}; };
case "front": case "front":
return { return {
x: snapValueToGrid(this.boxCreateIntersection.x, DEFAULT_GRID_SIZE), x: snapValueToGrid(this.boxCreateIntersection.x, DEFAULT_GRID_SIZE),
y: snapValueToGrid(this.boxCreateIntersection.y, 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": case "side":
return { 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), y: snapValueToGrid(this.boxCreateIntersection.y, DEFAULT_GRID_SIZE),
z: snapValueToGrid(this.boxCreateIntersection.z, DEFAULT_GRID_SIZE) z: snapValueToGrid(this.boxCreateIntersection.z, DEFAULT_GRID_SIZE)
}; };