Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Fixed horizontal auto-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Seneral committed Oct 13, 2019
1 parent 19f0059 commit b59b96f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Node_Editor/Framework/Core/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ protected internal virtual void AutoLayoutNode()
{
if (!AutoLayout || Event.current.type != EventType.Repaint)
return;

Rect nodeRect = rect;
Vector2 size = new Vector2();
size.y = Math.Max(nodeGUIHeight.y, MinSize.y) + 4;
Expand All @@ -370,8 +370,8 @@ protected internal virtual void AutoLayoutNode()
float knobSize = 0;
List<ConnectionKnob> verticalKnobs = connectionKnobs.Where (x => x.side == NodeSide.Bottom || x.side == NodeSide.Top).ToList ();
if (verticalKnobs.Count > 0)
knobSize = verticalKnobs.Max ((ConnectionKnob knob) => knob.GetGUIKnob ().xMax - nodeRect.xMin);
size.x = Math.Max (knobSize, MinSize.x);
knobSize = verticalKnobs.Max ((ConnectionKnob knob) => knob.GetCanvasSpaceKnob ().xMax - nodeRect.xMin);
size.x = Math.Max (knobSize, Math.Max (nodeGUIHeight.x, MinSize.x));

autoSize = size;
NodeEditor.RepaintClients ();
Expand Down

0 comments on commit b59b96f

Please sign in to comment.