Fix auto-sizing nodes with hidden default value fields (eg, comparison node)

#3540
This commit is contained in:
Wojtek Figat
2026-04-01 16:25:33 +02:00
parent 806027408a
commit 42ec33bd9a
2 changed files with 5 additions and 5 deletions

View File

@@ -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);
}

View File

@@ -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);