From 1366c8cb44add1cc53ca5fddd576323fb61bd320 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sun, 3 Nov 2024 07:14:49 +1100 Subject: [PATCH] Fix primitive resize when node size ref retained (#1405) * Fix primitive resize when node size ref retained Primitive assumes that setting node size property will replace the ref. Minimal change. * Use explicit variable names --- src/extensions/core/widgetInputs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/core/widgetInputs.ts b/src/extensions/core/widgetInputs.ts index 2d07762c0..1f0eff576 100644 --- a/src/extensions/core/widgetInputs.ts +++ b/src/extensions/core/widgetInputs.ts @@ -215,7 +215,7 @@ class PrimitiveNode extends LGraphNode { } // Store current size as addWidget resizes the node - const size = this.size + const [oldWidth, oldHeight] = this.size let widget if (type in ComfyWidgets) { widget = (ComfyWidgets[type](this, 'value', inputData, app) || {}).widget @@ -277,8 +277,8 @@ class PrimitiveNode extends LGraphNode { // Use the biggest dimensions in case the widgets caused the node to grow this.size = [ - Math.max(this.size[0], size[0]), - Math.max(this.size[1], size[1]) + Math.max(this.size[0], oldWidth), + Math.max(this.size[1], oldHeight) ] if (!recreating) {