Layout state change for moved nodes
This commit is contained in:
Submodule litegraph updated: 8354b10f9a...8a06a8b3ac
@@ -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",
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user