mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-11 10:30:10 +00:00
@@ -2409,7 +2409,9 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
|
||||
target_node.inputs[targetIndex].link = link_info.id
|
||||
|
||||
// Reroutes
|
||||
for (const x of LLink.getReroutes(graph, link_info)) x?.linkIds.add(nextId)
|
||||
for (const reroute of LLink.getReroutes(graph, link_info)) {
|
||||
reroute?.linkIds.add(nextId)
|
||||
}
|
||||
graph._version++
|
||||
|
||||
// link_info has been created now, so its updated
|
||||
|
||||
@@ -10,13 +10,17 @@ import { LGraphNode } from "@/LGraphNode"
|
||||
*/
|
||||
export function getAllNestedItems(items: ReadonlySet<Positionable>): Set<Positionable> {
|
||||
const allItems = new Set<Positionable>()
|
||||
if (items) for (const x of items) addRecursively(x, allItems)
|
||||
if (items) {
|
||||
for (const item of items) addRecursively(item, allItems)
|
||||
}
|
||||
return allItems
|
||||
|
||||
function addRecursively(item: Positionable, flatSet: Set<Positionable>): void {
|
||||
if (flatSet.has(item) || item.pinned) return
|
||||
flatSet.add(item)
|
||||
if (item.children) for (const x of item.children) addRecursively(x, flatSet)
|
||||
if (item.children) {
|
||||
for (const child of item.children) addRecursively(child, flatSet)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user