Fixed behaviour when no column width is provided
--HG-- branch : develop_5.3pull/413/head
parent
2e8682a491
commit
5a64abfa80
|
@ -122,9 +122,6 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
public override void CalculateLayoutInputVertical()
|
public override void CalculateLayoutInputVertical()
|
||||||
{
|
{
|
||||||
if (columnWidths.Length == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnWidths.Length);
|
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnWidths.Length);
|
||||||
|
|
||||||
maxPreferredHeightInRows = new float[rowCount];
|
maxPreferredHeightInRows = new float[rowCount];
|
||||||
|
@ -183,10 +180,10 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
public override void SetLayoutHorizontal()
|
public override void SetLayoutHorizontal()
|
||||||
{
|
{
|
||||||
int columnCount = columnWidths.Length;
|
if (columnWidths.Length == 0)
|
||||||
|
columnWidths = new float[1] { 0f };
|
||||||
|
|
||||||
if (columnCount == 0)
|
int columnCount = columnWidths.Length;
|
||||||
return;
|
|
||||||
|
|
||||||
for (int i = 0; i < rectChildren.Count; i++)
|
for (int i = 0; i < rectChildren.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -206,8 +203,6 @@ namespace UnityEngine.UI.Extensions
|
||||||
public override void SetLayoutVertical()
|
public override void SetLayoutVertical()
|
||||||
{
|
{
|
||||||
int columnCount = columnWidths.Length;
|
int columnCount = columnWidths.Length;
|
||||||
if (columnCount == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnCount);
|
int rowCount = Mathf.CeilToInt(rectChildren.Count / (float)columnCount);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue