Show an X if PickFirst fails to find a good input
This commit is contained in:
@@ -40,17 +40,34 @@ export default class ComfyPickFirstNode extends ComfyGraphNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override onDrawBackground(ctx: CanvasRenderingContext2D) {
|
override onDrawBackground(ctx: CanvasRenderingContext2D) {
|
||||||
if (this.flags.collapsed || this.selected === -1) {
|
if (this.flags.collapsed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.fillStyle = "#AFB";
|
if (this.selected === -1) {
|
||||||
var y = (this.selected) * LiteGraph.NODE_SLOT_HEIGHT + 6;
|
// Draw an X
|
||||||
ctx.beginPath();
|
const y = LiteGraph.NODE_SLOT_HEIGHT + 6;
|
||||||
ctx.moveTo(50, y);
|
ctx.lineWidth = 5;
|
||||||
ctx.lineTo(50, y + LiteGraph.NODE_SLOT_HEIGHT);
|
ctx.strokeStyle = "red";
|
||||||
ctx.lineTo(34, y + LiteGraph.NODE_SLOT_HEIGHT * 0.5);
|
ctx.beginPath();
|
||||||
ctx.fill();
|
|
||||||
|
ctx.moveTo(50 - 15, y - 15);
|
||||||
|
ctx.lineTo(50 + 15, y + 15);
|
||||||
|
ctx.stroke();
|
||||||
|
|
||||||
|
ctx.moveTo(50 + 15, y - 15);
|
||||||
|
ctx.lineTo(50 - 15, y + 15);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ctx.fillStyle = "#AFB";
|
||||||
|
const y = (this.selected) * LiteGraph.NODE_SLOT_HEIGHT + 6;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(50, y);
|
||||||
|
ctx.lineTo(50, y + LiteGraph.NODE_SLOT_HEIGHT);
|
||||||
|
ctx.lineTo(34, y + LiteGraph.NODE_SLOT_HEIGHT * 0.5);
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
override onConnectionsChange(
|
override onConnectionsChange(
|
||||||
|
|||||||
Reference in New Issue
Block a user