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

small element fixes

This commit is contained in:
Ellpeck 2019-08-20 23:04:21 +02:00
parent fac7f2beb0
commit 05f148514f

View file

@ -309,7 +309,7 @@ namespace MLEM.Ui.Elements {
foreach (var child in this.Children) foreach (var child in this.Children)
child.ForceUpdateArea(); child.ForceUpdateArea();
if (this.SetHeightBasedOnChildren) { if (this.SetHeightBasedOnChildren && this.Children.Count > 0) {
var height = 0; var height = 0;
foreach (var child in this.Children) { foreach (var child in this.Children) {
if (!child.isHidden && (child.Anchor <= Anchor.TopRight || child.Anchor >= Anchor.AutoLeft) && child.area.Bottom > height) if (!child.isHidden && (child.Anchor <= Anchor.TopRight || child.Anchor >= Anchor.AutoLeft) && child.area.Bottom > height)
@ -331,7 +331,7 @@ namespace MLEM.Ui.Elements {
(this.size.Y > 1 ? this.ScaledSize.Y : parentArea.Height * this.size.Y).Floor()); (this.size.Y > 1 ? this.ScaledSize.Y : parentArea.Height * this.size.Y).Floor());
} }
protected Rectangle GetAreaForAutoAnchors() { protected virtual Rectangle GetAreaForAutoAnchors() {
return this.Area; return this.Area;
} }