mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 08:49:36 +00:00
Fix corruption of selected link highlights (#897)
Occurred when deselecting one side of a link when both sides were selected.
This commit is contained in:
@@ -3365,16 +3365,28 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
|
||||
this.onNodeDeselected?.(item)
|
||||
|
||||
// Should be moved to top of function, and throw if null
|
||||
const { graph } = this
|
||||
if (!graph) return
|
||||
|
||||
// Clear link highlight
|
||||
if (item.inputs) {
|
||||
for (const input of item.inputs) {
|
||||
if (input.link == null) continue
|
||||
|
||||
const node = LLink.getOriginNode(graph, input.link)
|
||||
if (node && this.selectedItems.has(node)) continue
|
||||
|
||||
delete this.highlighted_links[input.link]
|
||||
}
|
||||
}
|
||||
if (item.outputs) {
|
||||
for (const id of item.outputs.flatMap(x => x.links)) {
|
||||
if (id == null) continue
|
||||
|
||||
const node = LLink.getTargetNode(graph, id)
|
||||
if (node && this.selectedItems.has(node)) continue
|
||||
|
||||
delete this.highlighted_links[id]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user