mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 11:10:00 +00:00
[Bug] Fix remove of floatingLinks (#792)
Resolves https://github.com/Comfy-Org/litegraph.js/issues/791 This PR fixes removal of floating links. --------- Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
This commit is contained in:
@@ -900,6 +900,13 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
}
|
||||
}
|
||||
|
||||
// Floating links
|
||||
for (const link of this.floatingLinks.values()) {
|
||||
if (link.origin_id === node.id || link.target_id === node.id) {
|
||||
this.removeFloatingLink(link)
|
||||
}
|
||||
}
|
||||
|
||||
// callback
|
||||
node.onRemoved?.()
|
||||
|
||||
@@ -1401,6 +1408,10 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
if (reroute.floatingLinkIds.size === 0) {
|
||||
delete reroute.floating
|
||||
}
|
||||
|
||||
if (reroute.floatingLinkIds.size === 0 && reroute.linkIds.size === 0) {
|
||||
this.removeReroute(reroute.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user