mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
add arrows to collapsed node
This commit is contained in:
@@ -5347,10 +5347,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
||||
continue;
|
||||
ctx.fillStyle = slot.colorOn || this.default_connection_color.input_on;
|
||||
ctx.beginPath();
|
||||
if ( slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE)
|
||||
if ( slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE) {
|
||||
ctx.rect(0.5, 4 - LiteGraph.NODE_TITLE_HEIGHT + 0.5,14,LiteGraph.NODE_TITLE_HEIGHT - 8);
|
||||
else
|
||||
ctx.arc( 0, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI*2 );
|
||||
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||
ctx.moveTo(8, LiteGraph.NODE_TITLE_HEIGHT * -0.5);
|
||||
ctx.lineTo(-4, LiteGraph.NODE_TITLE_HEIGHT * -0.8);
|
||||
ctx.lineTo(-4, LiteGraph.NODE_TITLE_HEIGHT * -0.2);
|
||||
ctx.closePath();
|
||||
} else {
|
||||
ctx.arc(0, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI * 2);
|
||||
}
|
||||
ctx.fill();
|
||||
break;
|
||||
}
|
||||
@@ -5366,10 +5372,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
||||
ctx.fillStyle = slot.colorOn || this.default_connection_color.output_on;
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.beginPath();
|
||||
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE)
|
||||
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE) {
|
||||
ctx.rect( node._collapsed_width - 4 + 0.5, 4 - LiteGraph.NODE_TITLE_HEIGHT + 0.5,14,LiteGraph.NODE_TITLE_HEIGHT - 8);
|
||||
else
|
||||
ctx.arc( node._collapsed_width, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI*2 );
|
||||
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||
ctx.moveTo(8, LiteGraph.NODE_TITLE_HEIGHT * -0.5);
|
||||
ctx.lineTo(-4, LiteGraph.NODE_TITLE_HEIGHT * -0.8);
|
||||
ctx.lineTo(-4, LiteGraph.NODE_TITLE_HEIGHT * -0.2);
|
||||
ctx.closePath();
|
||||
} else {
|
||||
ctx.arc(node._collapsed_width, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI * 2);
|
||||
}
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user