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
This commit is contained in:
filtered
2024-11-03 07:14:49 +11:00
committed by GitHub
parent 3a910f25e9
commit 1366c8cb44

View File

@@ -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) {