Fixed behaviour when no column width is provided

--HG--
branch : develop_5.3
pull/413/head
Rahul Raman 2016-12-28 06:46:38 +00:00
parent 2e8682a491
commit 5a64abfa80
1 changed files with 3 additions and 8 deletions

View File

@ -122,9 +122,6 @@ namespace UnityEngine.UI.Extensions
public override void CalculateLayoutInputVertical()
{
if (columnWidths.Length == 0)
return;
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnWidths.Length);
maxPreferredHeightInRows = new float[rowCount];
@ -183,10 +180,10 @@ namespace UnityEngine.UI.Extensions
public override void SetLayoutHorizontal()
{
int columnCount = columnWidths.Length;
if (columnWidths.Length == 0)
columnWidths = new float[1] { 0f };
if (columnCount == 0)
return;
int columnCount = columnWidths.Length;
for (int i = 0; i < rectChildren.Count; i++)
{
@ -206,8 +203,6 @@ namespace UnityEngine.UI.Extensions
public override void SetLayoutVertical()
{
int columnCount = columnWidths.Length;
if (columnCount == 0)
return;
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnCount);