Skip to content

Commit

Permalink
Fix primitive resize when node size ref retained (#1405)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
webfiltered authored Nov 2, 2024
1 parent 3a910f2 commit 1366c8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/extensions/core/widgetInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1366c8c

Please sign in to comment.