You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert "potentially cleaner version of our experrimental changes"
This reverts commit 618584c.
Revert "combine panel changes with the "more robust" approach"
This reverts commit ef3bd12.
@@ -1104,32 +1104,6 @@ public Vector2 TransformInverseAll(Vector2 position) {
1104
1104
returnthis.TransformInverse(position);
1105
1105
}
1106
1106
1107
-
/// <summary>
1108
-
/// A method called by <see cref="UiLayouter.Layout{T}"/> when a layout item's size is being recalculated based on its children.
1109
-
/// </summary>
1110
-
/// <param name="recursion">The current recursion depth.</param>
1111
-
/// <param name="relevantChild">The child that triggered the layout recursion. May be <see langword="null"/> in case the source of the layout recursion is unknown.</param>
varexceptionText=$"The area of {this} has recursively updated more often than the configured Element.RecursionLimit. This issue may occur due to this element or one of its children containing conflicting auto-sizing settings, a custom element setting its area dirty too frequently, or this element being part of a complex layout tree that should be split up into multiple groups.";
1119
-
if(relevantChild!=null)
1120
-
exceptionText+=$" Does its child {relevantChild} contain any conflicting auto-sizing settings?";
1121
-
thrownewArithmeticException(exceptionText);
1122
-
}
1123
-
}
1124
-
1125
-
/// <summary>
1126
-
/// A method called by <see cref="UiLayouter.Layout{T}"/> when a layout item's size is being calculated, but recursive calculations have settled.
1127
-
/// Also see <see cref="OnLayoutRecursion"/>, which is called for every recursive operation during element layouting.
1128
-
/// </summary>
1129
-
/// <param name="totalRecursion">The total reached recursion depth.</param>
1130
-
/// <param name="elementInternal"><see langword="true"/> if the settled recursive operation was element-internal (ie related to properties like <see cref="SetWidthBasedOnChildren"/> and <see cref="SetHeightBasedOnChildren"/>); <see langword="false"/> if the settled recursive operation was related to recursively updated children or parents of this element.</param>
varexceptionText=$"The area of {this} has recursively updated more often than the configured Element.RecursionLimit. This issue may occur due to this element or one of its children containing conflicting auto-sizing settings, a custom element setting its area dirty too frequently, or this element being part of a complex layout tree that should be split up into multiple groups.";
1140
+
if(relevantChild!=null)
1141
+
exceptionText+=$" Does its child {relevantChild} contain any conflicting auto-sizing settings?";
Copy file name to clipboardExpand all lines: MLEM.Ui/UiLayouter.cs
+12-25Lines changed: 12 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -15,25 +15,20 @@ public static class UiLayouter {
15
15
/// Lays out the given <paramref name="item"/> based on the information specified in its <see cref="ILayoutItem"/> interface.
16
16
/// </summary>
17
17
/// <param name="item">The item to lay out.</param>
18
-
/// <param name="recursionTracker">A reference to a field in the <paramref name="item"/> that is used by the layouter to track recursion counts across <see cref="Layout"/> calls.</param>
18
+
/// <param name="layoutRecursionTracker">A reference to a field in the <paramref name="item"/> that is used by the layouter to track recursion counts across <see cref="Layout"/> calls.</param>
19
19
/// <param name="epsilon">An epsilon value used in layout item size, position and resulting area calculations to mitigate floating point rounding inaccuracies.</param>
@@ -381,10 +376,11 @@ public interface ILayoutItem {
381
376
boolCanAutoAnchorsAttach{get;}
382
377
383
378
/// <summary>
384
-
/// Calculates the actual total size that this element should take up.
379
+
/// Calculates the actual size that this layout item should take up, based on the area that its parent encompasses.
380
+
/// By default, this is based on the information specified in <see cref="System.Drawing.Size"/>'s documentation.
385
381
/// </summary>
386
-
/// <param name="parentArea">This parent's area, or the ui system's viewport if it has no parent.</param>
387
-
/// <returns>The actual size of this element.</returns>
382
+
/// <param name="parentArea">This parent's area, or the ui system's viewport if it has no parent</param>
383
+
/// <returns>The actual size of this layout item, any scaling into account</returns>
388
384
Vector2CalcActualSize(RectangleFparentArea);
389
385
390
386
/// <summary>
@@ -405,19 +401,10 @@ public interface ILayoutItem {
405
401
406
402
/// <summary>
407
403
/// A method called by <see cref="UiLayouter.Layout{T}"/> when a layout item's size is being recalculated based on its children.
408
-
/// Also see <see cref="OnLayoutRecursionSettled"/>, which is called after recursive operations during element layouting have completed.
409
404
/// </summary>
410
405
/// <param name="recursion">The current recursion depth.</param>
411
406
/// <param name="relevantChild">The child that triggered the layout recursion. May be <see langword="null"/> in case the source of the layout recursion is unknown.</param>
/// A method called by <see cref="UiLayouter.Layout{T}"/> when a layout item's size is being calculated, but recursive calculations have settled.
416
-
/// Also see <see cref="OnLayoutRecursion"/>, which is called for every recursive operation during element layouting.
417
-
/// </summary>
418
-
/// <param name="totalRecursion">The total reached recursion depth.</param>
419
-
/// <param name="elementInternal"><see langword="true"/> if the settled recursive operation was element-internal (ie related to properties like <see cref="SetWidthBasedOnChildren"/> and <see cref="SetHeightBasedOnChildren"/>); <see langword="false"/> if the settled recursive operation was related to recursively updated children or parents of this element.</param>
0 commit comments