Layout state change for moved nodes

This commit is contained in:
space-nuko
2023-05-11 20:55:53 -05:00
parent 544db983e9
commit f9434251b6
3 changed files with 7 additions and 2 deletions

View File

@@ -8,7 +8,8 @@
"preview": "turbo run preview", "preview": "turbo run preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"test": "vitest run --root .", "test": "vitest run",
"test:watch": "vitest",
"lint": "prettier --plugin-search-dir . --check . && eslint .", "lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .", "format": "prettier --plugin-search-dir . --write .",
"svelte-check": "svelte-check", "svelte-check": "svelte-check",

View File

@@ -782,6 +782,10 @@ function nodeAdded(node: LGraphNode, options: LGraphAddNodeOptions) {
if (options.addedBy === "moveIntoSubgraph" || options.addedBy === "moveOutOfSubgraph") { if (options.addedBy === "moveIntoSubgraph" || options.addedBy === "moveOutOfSubgraph") {
// All we need to do is update the nodeID linked to this node. // All we need to do is update the nodeID linked to this node.
const item = state.allItemsByNode[options.prevNodeId]
delete state.allItemsByNode[options.prevNodeId]
state.allItemsByNode[node.id] = item
return;
} }
const parent = findDefaultContainerForInsertion(); const parent = findDefaultContainerForInsertion();