Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Runtime/Scripts/Layout/FlowLayoutGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public override void CalculateLayoutInputHorizontal()
base.CalculateLayoutInputHorizontal();
var minWidth = GetGreatestMinimumChildWidth() + padding.left + padding.right;
#if UNITY_6000_6_OR_NEWER
SetLayoutInputForAxis(minWidth, -1, -1, 0, 0);
// Unity 6.6+: (min, max, preferred, flexible, axis)
SetLayoutInputForAxis(minWidth, LayoutUtility.DefaultMaxSize, -1, -1, 0);
#else
SetLayoutInputForAxis(minWidth, -1, -1, 0);
#endif
Expand Down Expand Up @@ -78,10 +79,10 @@ public override void CalculateLayoutInputVertical()
base.CalculateLayoutInputHorizontal();
var minHeight = GetGreatestMinimumChildHeigth() + padding.bottom + padding.top;
#if UNITY_6000_6_OR_NEWER
SetLayoutInputForAxis(minHeight, -1, -1, 1, 1);
SetLayoutInputForAxis(minHeight, LayoutUtility.DefaultMaxSize, -1, -1, 1);
#else
SetLayoutInputForAxis(minHeight, -1, -1, 1);
#endif
#endif
}
}

Expand Down Expand Up @@ -283,7 +284,7 @@ public float SetLayout(int axis, bool layoutInput)
if (layoutInput)
{
#if UNITY_6000_6_OR_NEWER
SetLayoutInputForAxis(offset, offset, -1, axis, 0);
SetLayoutInputForAxis(offset, LayoutUtility.DefaultMaxSize, offset, -1, axis);
#else
SetLayoutInputForAxis(offset, offset, -1, axis);
#endif
Expand Down
9 changes: 6 additions & 3 deletions Runtime/Scripts/Layout/TableLayoutGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ public override void CalculateLayoutInputHorizontal()
}

horizontalSize -= columnSpacing;

#if UNITY_6000_6_OR_NEWER
SetLayoutInputForAxis(horizontalSize, horizontalSize, 0, 0, 0);
// Unity 6.6+: (min, max, preferred, flexible, axis) — fixed column width, so max == preferred
SetLayoutInputForAxis(horizontalSize, horizontalSize, horizontalSize, 0, 0);
#else
SetLayoutInputForAxis(horizontalSize, horizontalSize, 0, 0);
#endif
Expand Down Expand Up @@ -187,10 +189,11 @@ public override void CalculateLayoutInputVertical()

totalPreferredHeight = Mathf.Max(totalMinHeight, totalPreferredHeight);
#if UNITY_6000_6_OR_NEWER
SetLayoutInputForAxis(totalMinHeight, totalPreferredHeight, 1, 1, 1);
// flexible=1 → can grow, so max is unconstrained
SetLayoutInputForAxis(totalMinHeight, LayoutUtility.DefaultMaxSize, totalPreferredHeight, 1, 1);
#else
SetLayoutInputForAxis(totalMinHeight, totalPreferredHeight, 1, 1);
#endif
#endif
}

public override void SetLayoutHorizontal()
Expand Down
Loading