From 42ec33bd9ae37ea70db96451eb413c53351a7510 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 1 Apr 2026 16:25:33 +0200 Subject: [PATCH] Fix auto-sizing nodes with hidden default value fields (eg, comparison node) #3540 --- Source/Editor/Surface/Elements/Box.cs | 8 ++++---- Source/Editor/Surface/SurfaceNode.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Editor/Surface/Elements/Box.cs b/Source/Editor/Surface/Elements/Box.cs index 4c86af041..a110192cf 100644 --- a/Source/Editor/Surface/Elements/Box.cs +++ b/Source/Editor/Surface/Elements/Box.cs @@ -363,10 +363,10 @@ namespace FlaxEditor.Surface.Elements Assert.AreEqual(r1, r2); // Update - ConnectionTick(); - box.ConnectionTick(); OnConnectionsChanged(); box.OnConnectionsChanged(); + ConnectionTick(); + box.ConnectionTick(); Surface?.OnNodesDisconnected(this, box); } @@ -390,10 +390,10 @@ namespace FlaxEditor.Surface.Elements Assert.IsTrue(AreConnected(box)); // Update - ConnectionTick(); - box.ConnectionTick(); OnConnectionsChanged(); box.OnConnectionsChanged(); + ConnectionTick(); + box.ConnectionTick(); Surface?.OnNodesConnected(this, box); } diff --git a/Source/Editor/Surface/SurfaceNode.cs b/Source/Editor/Surface/SurfaceNode.cs index f1d241485..d28d04e1e 100644 --- a/Source/Editor/Surface/SurfaceNode.cs +++ b/Source/Editor/Surface/SurfaceNode.cs @@ -232,7 +232,7 @@ namespace FlaxEditor.Surface if (child is InputBox inputBox) { var boxWidth = boxLabelFont.MeasureText(inputBox.Text).X + 25; - if (inputBox.DefaultValueEditor != null) + if (inputBox.DefaultValueEditor != null && inputBox.DefaultValueEditor.Visible) boxWidth += inputBox.DefaultValueEditor.Width + 4; leftWidth = Mathf.Max(leftWidth, boxWidth); leftHeight = Mathf.Max(leftHeight, inputBox.Archetype.Position.Y - Constants.NodeMarginY - Constants.NodeHeaderHeight + Constants.BoxRowHeight);