Fix widget sizing logic in LGraphCanvas and LGraphNode (#609)

This fixes an issue with widget heights not coinciding with actual
computed heights.
<img
src="https://github.com/user-attachments/assets/50b4b86c-8de8-4844-9a17-6f18d32e7f5e"
height="128" alt="old">old
<img
src="https://github.com/user-attachments/assets/c34e432a-6941-469e-99cd-df15c0a527de"
height="256" alt="new">new
This commit is contained in:
Miguel C
2025-02-26 09:56:30 -06:00
committed by GitHub
parent 939e9c0a2f
commit 7e6b64f216
2 changed files with 8 additions and 4 deletions

View File

@@ -1898,9 +1898,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
continue
}
const h = widget.computeSize
? widget.computeSize(nodeWidth)[1]
: LiteGraph.NODE_WIDGET_HEIGHT
const h = widget.computedHeight ??
widget.computeSize?.(nodeWidth)[1] ??
LiteGraph.NODE_WIDGET_HEIGHT
const w = widget.width || nodeWidth
if (
widget.last_y !== undefined &&