From 7f5efca00befcf2b344cbd8804425153087b71f9 Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Fri, 24 Oct 2025 09:23:41 -0700 Subject: [PATCH] Respect minimum node size on subgraph conversion (#6241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small changes to improve sizing on subgraphs - On conversion, automatically promoted widgets can increase the minimum width of a node. When this occurs, the node is now automatically resized to respect this new minimum. image - On nodes with title_badges, titles now have greatly reduced empty padding before being abbreviated. image ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6241-Respect-minimum-node-size-on-subgraph-conversion-2956d73d3650817c867fe42d60afa28b) by [Unito](https://www.unito.io) --- src/core/graph/subgraph/proxyWidgetUtils.ts | 1 + src/lib/litegraph/src/LGraphNode.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/graph/subgraph/proxyWidgetUtils.ts b/src/core/graph/subgraph/proxyWidgetUtils.ts index f253d93ae..4f1b20108 100644 --- a/src/core/graph/subgraph/proxyWidgetUtils.ts +++ b/src/core/graph/subgraph/proxyWidgetUtils.ts @@ -161,4 +161,5 @@ export function promoteRecommendedWidgets(subgraphNode: SubgraphNode) { const proxyWidgets: ProxyWidgetsProperty = filteredWidgets.map(widgetItemToProperty) subgraphNode.properties.proxyWidgets = proxyWidgets + subgraphNode.computeSize(subgraphNode.size) } diff --git a/src/lib/litegraph/src/LGraphNode.ts b/src/lib/litegraph/src/LGraphNode.ts index 24f330148..b65b0d7f4 100644 --- a/src/lib/litegraph/src/LGraphNode.ts +++ b/src/lib/litegraph/src/LGraphNode.ts @@ -3680,7 +3680,7 @@ export class LGraphNode } ctx.font = savedFont // Restore font after button measurements if (buttonsWidth > 0) { - buttonsWidth += 10 // Extra margin before buttons + buttonsWidth -= 20 // Reduce by empty padding availableWidth -= buttonsWidth } }