mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Highlight arrow shape when connecting slots with arrow shape
This commit is contained in:
@@ -5682,9 +5682,11 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
var slot_type = node.inputs[slot].type;
|
var slot_type = node.inputs[slot].type;
|
||||||
if ( LiteGraph.isValidConnection( this.connecting_output.type, slot_type ) ) {
|
if ( LiteGraph.isValidConnection( this.connecting_output.type, slot_type ) ) {
|
||||||
this._highlight_input = pos;
|
this._highlight_input = pos;
|
||||||
|
this._highlight_input_slot = node.inputs[slot];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._highlight_input = null;
|
this._highlight_input = null;
|
||||||
|
this._highlight_input_slot = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6922,7 +6924,13 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
14,
|
14,
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
} else {
|
} else if (this.connecting_output.shape === LiteGraph.ARROW_SHAPE) {
|
||||||
|
ctx.moveTo(this.connecting_pos[0] + 8, this.connecting_pos[1] + 0.5);
|
||||||
|
ctx.lineTo(this.connecting_pos[0] - 4, this.connecting_pos[1] + 6 + 0.5);
|
||||||
|
ctx.lineTo(this.connecting_pos[0] - 4, this.connecting_pos[1] - 6 + 0.5);
|
||||||
|
ctx.closePath();
|
||||||
|
}
|
||||||
|
else {
|
||||||
ctx.arc(
|
ctx.arc(
|
||||||
this.connecting_pos[0],
|
this.connecting_pos[0],
|
||||||
this.connecting_pos[1],
|
this.connecting_pos[1],
|
||||||
@@ -6936,13 +6944,21 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
ctx.fillStyle = "#ffcc00";
|
ctx.fillStyle = "#ffcc00";
|
||||||
if (this._highlight_input) {
|
if (this._highlight_input) {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(
|
var shape = this._highlight_input_slot.shape;
|
||||||
this._highlight_input[0],
|
if (shape === LiteGraph.ARROW_SHAPE) {
|
||||||
this._highlight_input[1],
|
ctx.moveTo(this._highlight_input[0] + 8, this._highlight_input[1] + 0.5);
|
||||||
6,
|
ctx.lineTo(this._highlight_input[0] - 4, this._highlight_input[1] + 6 + 0.5);
|
||||||
0,
|
ctx.lineTo(this._highlight_input[0] - 4, this._highlight_input[1] - 6 + 0.5);
|
||||||
Math.PI * 2
|
ctx.closePath();
|
||||||
);
|
} else {
|
||||||
|
ctx.arc(
|
||||||
|
this._highlight_input[0],
|
||||||
|
this._highlight_input[1],
|
||||||
|
6,
|
||||||
|
0,
|
||||||
|
Math.PI * 2
|
||||||
|
);
|
||||||
|
}
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user