Add function to check if selection can be duplicated

This commit is contained in:
2026-04-05 04:23:49 +02:00
parent 5332d16d0a
commit f195d2b0b5

View File

@@ -457,6 +457,20 @@ function isTextEntryTarget(target) {
target instanceof HTMLSelectElement ||
target.isContentEditable);
}
function selectionCanBeDuplicated(selection) {
switch (selection.kind) {
case "brushes":
case "entities":
case "modelInstances":
return selection.ids.length > 0;
case "brushFace":
case "brushEdge":
case "brushVertex":
return true;
case "none":
return false;
}
}
function isCommitIncrementKey(key) {
return key === "ArrowUp" || key === "ArrowDown" || key === "PageUp" || key === "PageDown";
}