Fix custom widgets with draw may break rendering (#1072)

This commit is contained in:
filtered
2025-06-03 06:00:02 -07:00
committed by GitHub
parent ee2171b6ce
commit d225e77d30

View File

@@ -3440,11 +3440,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
if (widget.computedDisabled) ctx.globalAlpha *= 0.5 if (widget.computedDisabled) ctx.globalAlpha *= 0.5
const width = widget.width || nodeWidth const width = widget.width || nodeWidth
const widgetInstance = toConcreteWidget(widget, this, false) if (typeof widget.draw === "function") {
if (widgetInstance) { widget.draw(ctx, this, width, y, H, lowQuality)
widgetInstance.drawWidget(ctx, { width, showText })
} else { } else {
widget.draw?.(ctx, this, width, y, H, lowQuality) toConcreteWidget(widget, this, false)?.drawWidget(ctx, { width, showText })
} }
ctx.globalAlpha = editorAlpha ctx.globalAlpha = editorAlpha
} }