mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
Fix incorrect links highlighted (#670)
Fixes rare issue where incorrect links could be highlighted (and seemingly remain highlighted). Requires corrupt links & null coercion.
This commit is contained in:
@@ -3753,11 +3753,13 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
// Highlight links
|
||||
if (item.inputs) {
|
||||
for (const input of item.inputs) {
|
||||
if (input.link == null) continue
|
||||
this.highlighted_links[input.link] = true
|
||||
}
|
||||
}
|
||||
if (item.outputs) {
|
||||
for (const id of item.outputs.flatMap(x => x.links)) {
|
||||
if (id == null) continue
|
||||
this.highlighted_links[id] = true
|
||||
}
|
||||
}
|
||||
@@ -3783,11 +3785,13 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
// Clear link highlight
|
||||
if (item.inputs) {
|
||||
for (const input of item.inputs) {
|
||||
if (input.link == null) continue
|
||||
delete this.highlighted_links[input.link]
|
||||
}
|
||||
}
|
||||
if (item.outputs) {
|
||||
for (const id of item.outputs.flatMap(x => x.links)) {
|
||||
if (id == null) continue
|
||||
delete this.highlighted_links[id]
|
||||
}
|
||||
}
|
||||
@@ -3882,11 +3886,13 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
// Highlight links
|
||||
if (keepSelected.inputs) {
|
||||
for (const input of keepSelected.inputs) {
|
||||
if (input.link == null) continue
|
||||
this.highlighted_links[input.link] = true
|
||||
}
|
||||
}
|
||||
if (keepSelected.outputs) {
|
||||
for (const id of keepSelected.outputs.flatMap(x => x.links)) {
|
||||
if (id == null) continue
|
||||
this.highlighted_links[id] = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user