mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-14 17:37:46 +00:00
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:
@@ -1929,9 +1929,12 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
for (const widget of node.widgets) {
|
||||
if (widget.hidden || (widget.advanced && !node.showAdvanced)) continue
|
||||
|
||||
let widgetWidth, widgetHeight
|
||||
let widgetWidth: number, widgetHeight: number
|
||||
if (widget.computeSize) {
|
||||
([widgetWidth, widgetHeight] = widget.computeSize(node.size[0]))
|
||||
} else if (widget.computeLayoutSize) {
|
||||
widgetWidth = widget.width
|
||||
widgetHeight = widget.computedHeight
|
||||
} else {
|
||||
widgetWidth = widget.width || node.size[0]
|
||||
widgetHeight = LiteGraph.NODE_WIDGET_HEIGHT
|
||||
|
||||
Reference in New Issue
Block a user