File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
UnityNativeToolkit/Assets/Scripts/Utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ public override void CalculateLayoutInputHorizontal()
4949 float parentWidth = rectTransform . rect . width ;
5050 float parentHeight = rectTransform . rect . height ;
5151
52- float cellWidth = ( parentWidth / ( float ) columns ) - ( ( spacing . x / ( float ) columns ) * ( columns - 1 ) ) - ( padding . left / ( float ) columns ) - ( padding . right / ( float ) columns ) ;
53- float cellHeight = parentHeight / ( float ) rows - ( ( spacing . y / ( float ) rows ) * ( columns - 1 ) ) - ( padding . top / ( float ) rows ) - ( padding . bottom / ( float ) rows ) ;
52+ float cellWidth = ( parentWidth / ( float ) columns ) - ( spacing . x / ( float ) columns * ( columns - 1 ) ) - ( padding . left / ( float ) columns ) - ( padding . right / ( float ) columns ) ;
53+ float cellHeight = ( parentHeight / ( float ) rows ) - ( spacing . y / ( float ) rows * ( rows - 1 ) ) - ( padding . top / ( float ) rows ) - ( padding . bottom / ( float ) rows ) ;
5454
5555 cellSize . x = fitX ? cellWidth : cellSize . x ;
5656 cellSize . y = fitY ? cellHeight : cellSize . y ;
@@ -66,7 +66,7 @@ public override void CalculateLayoutInputHorizontal()
6666 var item = rectChildren [ i ] ;
6767
6868 var xPos = ( cellSize . x * columnCount ) + ( spacing . x * columnCount ) + padding . left ;
69- var yPos = ( cellSize . y * rowCount ) + ( spacing . y * columnCount ) + padding . top ;
69+ var yPos = ( cellSize . y * rowCount ) + ( spacing . y * rowCount ) + padding . top ;
7070
7171 SetChildAlongAxis ( item , 0 , xPos , cellSize . x ) ;
7272 SetChildAlongAxis ( item , 1 , yPos , cellSize . y ) ;
You can’t perform that action at this time.
0 commit comments