Fix auto-sizing nodes with hidden default value fields (eg, comparison node)
#3540
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user