Fixed computation of cell positions for all start corners

--HG--
branch : develop_5.3
pull/413/head
Rahul Raman 2016-12-27 20:28:12 +00:00
parent 81dd26b5ef
commit ff95c38ee2
1 changed files with 9 additions and 5 deletions

View File

@ -231,7 +231,7 @@ namespace UnityEngine.UI.Extensions
float sizeYOfRect = maxPreferredHeightInRows[i] + rowSpacing;
if (cornerY == 1)
positionY -= sizeYOfRect;
positionY -= maxPreferredHeightInRows[i];
for (int j = 0; j < columnCount; j++)
{
@ -243,16 +243,20 @@ namespace UnityEngine.UI.Extensions
float sizeXOfRect = columnWidths[j] + cellSpacing;
if (cornerX == 1)
positionX -= sizeXOfRect;
positionX -= columnWidths[j];
SetChildAlongAxis(rectChildren[childIndex], 0, positionX, columnWidths[j]);
SetChildAlongAxis(rectChildren[childIndex], 1, positionY, maxPreferredHeightInRows[i]);
if (cornerX != 1)
if (cornerX == 1)
positionX -= cellSpacing;
else
positionX += sizeXOfRect;
}
if (cornerY != 1)
if (cornerY == 1)
positionY -= rowSpacing;
else
positionY += sizeYOfRect;
}
}