1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

make the elementhelper's last column use AutoInlineIgnoreOverflow to avoid imperfect rounding causing it to move down

This commit is contained in:
Ellpeck 2019-09-11 15:03:10 +02:00
parent 2084f927ae
commit b8bf5c28d9

View file

@ -28,7 +28,8 @@ namespace MLEM.Ui.Elements {
public static Group[] MakeColumns(Element parent, Vector2 totalSize, int amount, bool setHeightBasedOnChildren = true) { public static Group[] MakeColumns(Element parent, Vector2 totalSize, int amount, bool setHeightBasedOnChildren = true) {
var cols = new Group[amount]; var cols = new Group[amount];
for (var i = 0; i < amount; i++) { for (var i = 0; i < amount; i++) {
cols[i] = new Group(Anchor.AutoInline, new Vector2(totalSize.X / amount, totalSize.Y), setHeightBasedOnChildren); var anchor = i == amount - 1 ? Anchor.AutoInlineIgnoreOverflow : Anchor.AutoInline;
cols[i] = new Group(anchor, new Vector2(totalSize.X / amount, totalSize.Y), setHeightBasedOnChildren);
if (parent != null) if (parent != null)
parent.AddChild(cols[i]); parent.AddChild(cols[i]);
} }