fix: duplicate shapes without position offset

This commit is contained in:
Formsmith746
2026-08-30 08:29:37 +03:00
parent 34528e6393
commit 62502b7e35
2 changed files with 5 additions and 8 deletions
@@ -7083,14 +7083,7 @@ export function SketchForgeEditor({
setNotice("Select a shape first");
return;
}
const duplicates = selectedShapes.map((shape) => {
const duplicate = cloneWorkplaneShapeTreeWithFreshIds(shape, "copy");
return {
...duplicate,
x: Math.min(110, shape.x + 8),
z: Math.min(110, shape.z + 8),
};
});
const duplicates = selectedShapes.map((shape) => cloneWorkplaneShapeTreeWithFreshIds(shape, "copy"));
commitShapes([...shapes, ...duplicates], duplicates.map((shape) => shape.id), `Duplicated ${duplicates.length} shape${duplicates.length === 1 ? "" : "s"}`);
}, [commitShapes, hasSelection, selectedShapes, shapes]);