Shape Grid Child Alignment problem

Zaddo

Active member
Hi,

I think there might be a bug with the child alignment on the shape grid. If this is set to upperright and the container panel width does not match the grid size, then the items are not centered in the grid. Is there an adjustment value somewhere that I am missing?

In the video, I show the grid working correctly with left alignment. Then I change the alignment, and show the problem.

I can get around this, because the grid size is fixed. I am just posting this, in case it is a bug, to go in your backlog :)

 
When I designed the grid I made the assumption that the Grid and the ItemViews inside it would be anchored in the Top Left. I compute the items position manuallly in relation to the top left of the rect transform and use the grid cell size to compute the difference and X and Y.

I wouldn't consider that as much a bug but more of a limitation, considering it does not prevent you from getting the same result. If you make the parent Rect Transform the exact same size as the Grid then it shouldn't be a problem. Considering grid sizes cannot change dynamically it shouldn't be a problem.

If there is a use case I am missing do let me know and then I can look into it more in depth.
 
HI Sangemdoko,

You are correct, it is just a limitation and it is easy to work around. I only posted in case it was unexpected.
 
Top