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
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ private set {
59
59
/// <summary>
60
60
/// The scale that this ui element renders with
61
61
/// </summary>
62
-
publicfloatScale=>this.Root.ActualScale;
62
+
publicfloatScale=>this.Root?.ActualScale??thrownewNullReferenceException($"Cannot query scale of element {this} that does not have a root element");
63
63
/// <summary>
64
64
/// The <see cref="Anchor"/> that this element uses for positioning within its parent
65
65
/// </summary>
@@ -320,7 +320,7 @@ public virtual bool PreventParentSpill {
320
320
/// Returns whether this element is its <see cref="Root"/>'s <see cref="RootElement.SelectedElement"/>.
321
321
/// Note that, unlike <see cref="IsSelectedActive"/>, this property will be <see langword="true"/> even if this element's <see cref="Root"/> is not the <see cref="UiControls.ActiveRoot"/>.
/// Returns whether this element is its <see cref="Controls"/>'s <see cref="UiControls.SelectedElement"/>.
326
326
/// Note that <see cref="IsSelected"/> can be used to query whether this element is its <see cref="Root"/>'s <see cref="RootElement.SelectedElement"/> instead.
@@ -1061,7 +1061,8 @@ public Vector2 TransformInverse(Vector2 position) {
1061
1061
/// <param name="position">The position to transform</param>
0 commit comments