diff --git a/src/NodeSlot.ts b/src/NodeSlot.ts index 263d6cd00d..c41d833b21 100644 --- a/src/NodeSlot.ts +++ b/src/NodeSlot.ts @@ -97,6 +97,7 @@ export abstract class NodeSlot implements INodeSlot { nameLocked?: boolean pos?: Point widget?: IWidget + hasErrors?: boolean constructor(slot: INodeSlot) { Object.assign(this, slot) @@ -237,6 +238,15 @@ export abstract class NodeSlot implements INodeSlot { } } + // Draw a red circle if the slot has errors. + if (this.hasErrors) { + ctx.lineWidth = 2 + ctx.strokeStyle = "red" + ctx.beginPath() + ctx.arc(pos[0], pos[1], 12, 0, Math.PI * 2) + ctx.stroke() + } + // Restore the original fillStyle and strokeStyle ctx.fillStyle = originalFillStyle ctx.strokeStyle = originalStrokeStyle diff --git a/src/interfaces.ts b/src/interfaces.ts index 47cb66b85a..f5c4d25d1e 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -291,6 +291,10 @@ export interface INodeSlot { * This is calculated at runtime; it is **not** serialized. */ _floatingLinks?: Set + /** + * Whether the slot has errors. It is **not** serialized. + */ + hasErrors?: boolean } export interface INodeFlags {