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
Copy file name to clipboardExpand all lines: MLEM.Ui/Elements/Element.cs
+30-9Lines changed: 30 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1104,6 +1104,32 @@ 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?";
@@ -376,11 +379,10 @@ public interface ILayoutItem {
376
379
boolCanAutoAnchorsAttach{get;}
377
380
378
381
/// <summary>
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.
382
+
/// Calculates the actual total size that this element should take up.
381
383
/// </summary>
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>
384
+
/// <param name="parentArea">This parent's area, or the ui system's viewport if it has no parent.</param>
385
+
/// <returns>The actual size of this element.</returns>
384
386
Vector2CalcActualSize(RectangleFparentArea);
385
387
386
388
/// <summary>
@@ -401,10 +403,19 @@ public interface ILayoutItem {
401
403
402
404
/// <summary>
403
405
/// A method called by <see cref="UiLayouter.Layout{T}"/> when a layout item's size is being recalculated based on its children.
406
+
/// Also see <see cref="OnLayoutRecursionSettled"/>, which is called after recursive operations during element layouting have completed.
404
407
/// </summary>
405
408
/// <param name="recursion">The current recursion depth.</param>
406
409
/// <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.
414
+
/// Also see <see cref="OnLayoutRecursion"/>, which is called for every recursive operation during element layouting.
415
+
/// </summary>
416
+
/// <param name="totalRecursion">The total reached recursion depth.</param>
417
+
/// <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