Skip to content

Commit

Permalink
Merge pull request #363 from skadefro/master
Browse files Browse the repository at this point in the history
Fix delete not always removing all selected nodes
  • Loading branch information
newcat committed Jan 13, 2024
2 parents 3635f04 + aa23d9a commit f8bcbf5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/renderer-vue/src/graph/deleteNodes.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export function registerDeleteNodesCommand(displayedGraph: Ref<Graph>, handler:
handler.registerCommand(DELETE_NODES_COMMAND, {
canExecute: () => displayedGraph.value.selectedNodes.length > 0,
execute() {
displayedGraph.value.selectedNodes.forEach((n) => displayedGraph.value.removeNode(n));
for (let i = displayedGraph.value.selectedNodes.length - 1; i >= 0; i--) {
const n = displayedGraph.value.selectedNodes[i];
displayedGraph.value.removeNode(n);
}
},
});
handler.registerHotkey(["Delete"], DELETE_NODES_COMMAND);
Expand Down

0 comments on commit f8bcbf5

Please sign in to comment.