From 6b3d4aba7f5862f98dbe3be77905e12b45a72dc7 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 07:52:34 +0200 Subject: [PATCH] Update brush transformation logic to use updateBrush function --- .../set-box-brush-transform-command.ts | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/commands/set-box-brush-transform-command.ts b/src/commands/set-box-brush-transform-command.ts index e9bf782e..f658321d 100644 --- a/src/commands/set-box-brush-transform-command.ts +++ b/src/commands/set-box-brush-transform-command.ts @@ -7,6 +7,7 @@ import { cloneBrushGeometry, deriveBrushSizeFromGeometry, scaleBrushGeometryToSize, + updateBrush, type BrushGeometry, type WhiteboxEdgeId, type WhiteboxFaceId, @@ -119,13 +120,15 @@ export function createSetBoxBrushTransformCommand(options: SetBoxBrushTransformC assertPositiveSize(nextSize); context.setDocument( - replaceBrush(currentDocument, { - ...brush, - center: cloneVec3(options.center), - rotationDegrees: cloneVec3(options.rotationDegrees), - size: nextSize, - geometry: nextGeometry - }) + replaceBrush( + currentDocument, + updateBrush(brush, { + center: cloneVec3(options.center), + rotationDegrees: cloneVec3(options.rotationDegrees), + size: nextSize, + geometry: nextGeometry + }) + ) ); context.setSelection(selectionToEditorSelection(options.selection)); context.setToolMode("select"); @@ -140,13 +143,15 @@ export function createSetBoxBrushTransformCommand(options: SetBoxBrushTransformC const brush = getBoxBrushOrThrow(currentDocument, brushId); context.setDocument( - replaceBrush(currentDocument, { - ...brush, - center: cloneVec3(previousSnapshot.center), - rotationDegrees: cloneVec3(previousSnapshot.rotationDegrees), - size: cloneVec3(previousSnapshot.size), - geometry: cloneBrushGeometry(previousSnapshot.geometry) - }) + replaceBrush( + currentDocument, + updateBrush(brush, { + center: cloneVec3(previousSnapshot.center), + rotationDegrees: cloneVec3(previousSnapshot.rotationDegrees), + size: cloneVec3(previousSnapshot.size), + geometry: cloneBrushGeometry(previousSnapshot.geometry) + }) + ) ); if (previousSelection !== null) {