add pin rendering

This commit is contained in:
sfja 2026-05-13 17:17:46 +02:00
parent 0343ded6c8
commit ed36f21bb2

View File

@ -19,6 +19,8 @@ export class Board {
def: { def: {
size: { x: w, y: h }, size: { x: w, y: h },
label, label,
inputs,
outputs,
}, },
pos: { x, y }, pos: { x, y },
} = comp; } = comp;
@ -28,6 +30,7 @@ export class Board {
c.strokeStyle = `#333333`; c.strokeStyle = `#333333`;
c.lineWidth = 2; c.lineWidth = 2;
c.strokeRect(x + offset.x, y + offset.y, w, h); c.strokeRect(x + offset.x, y + offset.y, w, h);
c.fillStyle = `#333333`; c.fillStyle = `#333333`;
c.font = "bold 16px monospace"; c.font = "bold 16px monospace";
const textMetrix = c.measureText(label); const textMetrix = c.measureText(label);
@ -36,6 +39,9 @@ export class Board {
x + offset.x + w / 2 - textMetrix.width / 2, x + offset.x + w / 2 - textMetrix.width / 2,
y + offset.y + 13 + h / 2 - 16 / 2, y + offset.y + 13 + h / 2 - 16 / 2,
); );
const pinSpace = h / (inputs.length + 1);
for (let i = 0; i < inputs.length; ++i) {}
} }
} }
} }