"IPXE/git@developer.sourcefind.cn:dadigang/Ventoy.git" did not exist on "fd0d335eb69950ceaed69adeac72064987cd79b9"
Commit 97f3c230 authored by pythongosssss's avatar pythongosssss
Browse files

Fix node link colors

parent a5d3eb97
...@@ -65,7 +65,7 @@ app.registerExtension({ ...@@ -65,7 +65,7 @@ app.registerExtension({
if (outputs.length) { if (outputs.length) {
for (const linkId of outputs) { for (const linkId of outputs) {
const link = app.graph.links[linkId]; const link = app.graph.links[linkId];
// When disconnecting sometimes the link is still registered // When disconnecting sometimes the link is still registered
if (!link) continue; if (!link) continue;
...@@ -92,14 +92,21 @@ app.registerExtension({ ...@@ -92,14 +92,21 @@ app.registerExtension({
} }
} }
const displayType = inputType || outputType || "*";
// Update the types of each node // Update the types of each node
for (const node of updateNodes) { for (const node of updateNodes) {
// If we dont have an input type we are always wildcard but we'll show the output type // If we dont have an input type we are always wildcard but we'll show the output type
// This lets you change the output link to a different type and all nodes will update // This lets you change the output link to a different type and all nodes will update
node.outputs[0].type = inputType || "*"; node.outputs[0].type = inputType || "*";
node.__outputType = inputType || outputType || "*"; node.__outputType = displayType;
node.outputs[0].name = node.properties.showOutputText ? inputType || outputType || "*" : ""; node.outputs[0].name = node.properties.showOutputText ? displayType : "";
node.size = node.computeSize(); node.size = node.computeSize();
const color = LGraphCanvas.link_type_colors[displayType];
for (const l of node.outputs[0].links || []) {
app.graph.links[l].color = color;
}
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment