Enum support

This commit is contained in:
space-nuko
2023-05-28 20:06:08 -05:00
parent e411d29f09
commit fe736232a9
5 changed files with 168 additions and 37 deletions

View File

@@ -194,6 +194,8 @@ export default class ComfyGraphCanvas extends LGraphCanvas {
}
}
private static CONNECTION_POS: Vector2 = [0, 0];
private highlightNodeInput(node: LGraphNode, inputSlot: SlotNameOrIndex, ctx: CanvasRenderingContext2D) {
let inputIndex: number;
if (typeof inputSlot === "number")
@@ -201,7 +203,7 @@ export default class ComfyGraphCanvas extends LGraphCanvas {
else
inputIndex = node.findInputSlotIndexByName(inputSlot)
if (inputIndex !== -1) {
let pos = node.getConnectionPos(true, inputIndex);
let pos = node.getConnectionPos(true, inputIndex, ComfyGraphCanvas.CONNECTION_POS);
ctx.beginPath();
ctx.arc(pos[0] - node.pos[0], pos[1] - node.pos[1], 12, 0, 2 * Math.PI, false)
ctx.stroke();