Another adjustment to have position aligned too #796

This commit is contained in:
Wojtek Figat
2022-10-24 16:44:11 +02:00
parent 87a0c671f6
commit f078499dfb

View File

@@ -720,14 +720,14 @@ namespace FlaxEditor.Content.GUI
if (itemsToFit < 1)
itemsToFit = 1;
float itemsWidth = width / Mathf.Max(itemsToFit, 1);
var flooredItemsWidth = Mathf.Floor(itemsWidth);
float itemsHeight = itemsWidth / defaultItemsWidth * (ContentItem.DefaultHeight * viewScale);
var flooredItemsWidth = Mathf.Floor(itemsWidth);
var flooredItemsHeight = Mathf.Floor(itemsHeight);
x = itemsToFit == 1 ? 0 : itemsWidth / itemsToFit;
for (int i = 0; i < _children.Count; i++)
{
var c = _children[i];
c.Bounds = new Rectangle(x, y, flooredItemsWidth, flooredItemsHeight);
c.Bounds = new Rectangle(Mathf.Floor(x), Mathf.Floor(y), flooredItemsWidth, flooredItemsHeight);
x += itemsWidth + itemsWidth / itemsToFit;
if (x + itemsWidth > width)