mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-23 05:08:34 +01:00
fixed auto-sized elements without children not being updated correctly
This commit is contained in:
parent
f71f998508
commit
7792ce99c8
1 changed files with 5 additions and 1 deletions
|
@ -634,6 +634,8 @@ namespace MLEM.Ui.Elements {
|
||||||
autoSize.Y = newHeight;
|
autoSize.Y = newHeight;
|
||||||
foundChild = lowest;
|
foundChild = lowest;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
autoSize.Y = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.SetWidthBasedOnChildren) {
|
if (this.SetWidthBasedOnChildren) {
|
||||||
|
@ -644,11 +646,13 @@ namespace MLEM.Ui.Elements {
|
||||||
autoSize.X = newWidth;
|
autoSize.X = newWidth;
|
||||||
foundChild = rightmost;
|
foundChild = rightmost;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
autoSize.X = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.TreatSizeAsMinimum)
|
if (this.TreatSizeAsMinimum)
|
||||||
autoSize = Vector2.Max(autoSize, actualSize);
|
autoSize = Vector2.Max(autoSize, actualSize);
|
||||||
if (foundChild != null) {
|
if (autoSize != this.UnscrolledArea.Size) {
|
||||||
recursion++;
|
recursion++;
|
||||||
if (recursion >= 16) {
|
if (recursion >= 16) {
|
||||||
throw new ArithmeticException($"The area of {this} with root {this.Root?.Name} has recursively updated too often. Does its child {foundChild} contain any conflicting auto-sizing settings?");
|
throw new ArithmeticException($"The area of {this} with root {this.Root?.Name} has recursively updated too often. Does its child {foundChild} contain any conflicting auto-sizing settings?");
|
||||||
|
|
Loading…
Reference in a new issue