From d225e77d30892a6aa927dc1842c95016cf9e4af3 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Tue, 3 Jun 2025 06:00:02 -0700 Subject: [PATCH] Fix custom widgets with draw may break rendering (#1072) --- src/LGraphNode.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index af49f49999..3228148721 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -3440,11 +3440,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { if (widget.computedDisabled) ctx.globalAlpha *= 0.5 const width = widget.width || nodeWidth - const widgetInstance = toConcreteWidget(widget, this, false) - if (widgetInstance) { - widgetInstance.drawWidget(ctx, { width, showText }) + if (typeof widget.draw === "function") { + widget.draw(ctx, this, width, y, H, lowQuality) } else { - widget.draw?.(ctx, this, width, y, H, lowQuality) + toConcreteWidget(widget, this, false)?.drawWidget(ctx, { width, showText }) } ctx.globalAlpha = editorAlpha }