mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
@@ -50,6 +50,7 @@ var LiteGraph = global.LiteGraph = {
|
|||||||
ROUND_SHAPE: 2,
|
ROUND_SHAPE: 2,
|
||||||
CIRCLE_SHAPE: 3,
|
CIRCLE_SHAPE: 3,
|
||||||
CARD_SHAPE: 4,
|
CARD_SHAPE: 4,
|
||||||
|
ARROW_SHAPE: 5,
|
||||||
|
|
||||||
//enums
|
//enums
|
||||||
INPUT: 1,
|
INPUT: 1,
|
||||||
@@ -5241,10 +5242,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
|||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
||||||
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE)
|
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE) {
|
||||||
ctx.rect((pos[0] - 6) + 0.5, (pos[1] - 5) + 0.5,14,10);
|
ctx.rect((pos[0] - 6) + 0.5, (pos[1] - 5) + 0.5, 14, 10);
|
||||||
else
|
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||||
ctx.arc(pos[0],pos[1],4,0,Math.PI*2);
|
ctx.moveTo(pos[0] + 8, pos[1] + 0.5);
|
||||||
|
ctx.lineTo(pos[0] - 4, (pos[1] + 6) + 0.5);
|
||||||
|
ctx.lineTo(pos[0] - 4, (pos[1] - 6) + 0.5);
|
||||||
|
ctx.closePath();
|
||||||
|
} else {
|
||||||
|
ctx.arc(pos[0], pos[1], 4, 0, Math.PI * 2);
|
||||||
|
}
|
||||||
|
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
@@ -5281,10 +5288,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
|||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
//ctx.rect( node.size[0] - 14,i*14,10,10);
|
//ctx.rect( node.size[0] - 14,i*14,10,10);
|
||||||
|
|
||||||
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE)
|
if (slot.type === LiteGraph.EVENT || slot.shape === LiteGraph.BOX_SHAPE) {
|
||||||
ctx.rect((pos[0] - 6) + 0.5,(pos[1] - 5) + 0.5,14,10);
|
ctx.rect((pos[0] - 6) + 0.5,(pos[1] - 5) + 0.5,14,10);
|
||||||
else
|
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||||
ctx.arc( pos[0],pos[1],4,0, Math.PI*2 );
|
ctx.moveTo(pos[0] + 8, pos[1] + 0.5);
|
||||||
|
ctx.lineTo(pos[0] - 4, (pos[1] + 6) + 0.5);
|
||||||
|
ctx.lineTo(pos[0] - 4, (pos[1] - 6) + 0.5);
|
||||||
|
ctx.closePath();
|
||||||
|
} else {
|
||||||
|
ctx.arc(pos[0], pos[1], 4, 0, Math.PI * 2);
|
||||||
|
}
|
||||||
|
|
||||||
//trigger
|
//trigger
|
||||||
//if(slot.node_id != null && slot.slot == -1)
|
//if(slot.node_id != null && slot.slot == -1)
|
||||||
@@ -5332,10 +5345,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
|||||||
continue;
|
continue;
|
||||||
ctx.fillStyle = slot.colorOn || this.default_connection_color.input_on;
|
ctx.fillStyle = slot.colorOn || this.default_connection_color.input_on;
|
||||||
ctx.beginPath();
|
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);
|
ctx.rect(0.5, 4 - LiteGraph.NODE_TITLE_HEIGHT + 0.5,14,LiteGraph.NODE_TITLE_HEIGHT - 8);
|
||||||
else
|
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||||
ctx.arc( 0, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI*2 );
|
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();
|
ctx.fill();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5351,10 +5370,16 @@ LGraphCanvas.prototype.drawNode = function(node, ctx )
|
|||||||
ctx.fillStyle = slot.colorOn || this.default_connection_color.output_on;
|
ctx.fillStyle = slot.colorOn || this.default_connection_color.output_on;
|
||||||
ctx.strokeStyle = "black";
|
ctx.strokeStyle = "black";
|
||||||
ctx.beginPath();
|
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);
|
ctx.rect( node._collapsed_width - 4 + 0.5, 4 - LiteGraph.NODE_TITLE_HEIGHT + 0.5,14,LiteGraph.NODE_TITLE_HEIGHT - 8);
|
||||||
else
|
} else if (slot.shape === LiteGraph.ARROW_SHAPE) {
|
||||||
ctx.arc( node._collapsed_width, LiteGraph.NODE_TITLE_HEIGHT * -0.5, 4, 0, Math.PI*2 );
|
ctx.moveTo(node._collapsed_width + 6, LiteGraph.NODE_TITLE_HEIGHT * -0.5);
|
||||||
|
ctx.lineTo(node._collapsed_width - 6, LiteGraph.NODE_TITLE_HEIGHT * -0.8);
|
||||||
|
ctx.lineTo(node._collapsed_width - 6, 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.fill();
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user