Enhance selection duplication logic and update tests

This commit is contained in:
2026-04-05 04:33:28 +02:00
parent db1210831c
commit 0581d49ecc
2 changed files with 13 additions and 1 deletions

View File

@@ -2129,7 +2129,15 @@ export function App({ store, initialStatusMessage }) {
}
try {
store.executeCommand(createDuplicateSelectionCommand());
setStatusMessage("Duplicated selection.");
const duplicatedSelection = store.getState().selection;
const canGrabDuplicatedSelection = (duplicatedSelection.kind === "brushes" || duplicatedSelection.kind === "entities" || duplicatedSelection.kind === "modelInstances") &&
duplicatedSelection.ids.length === 1;
if (canGrabDuplicatedSelection) {
beginTransformOperation("translate", "keyboard");
}
else {
setStatusMessage("Duplicated selection.");
}
return true;
}
catch (error) {