From 4d4c046556f9d8989ae8edcf583c721259d15395 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 25 Jan 2025 15:35:07 -0600 Subject: [PATCH] small cleanup with uicanvas searching. --- Source/Editor/Viewport/MainEditorGizmoViewport.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs index 88f59b0c9..e106aeec2 100644 --- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs +++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs @@ -342,7 +342,7 @@ namespace FlaxEditor.Viewport { UICanvas canvas = null; var controlParent = control.Parent; - while (controlParent != null || controlParent is not Scene) + while (controlParent != null && controlParent is not Scene) { if (controlParent is UICanvas uiCanvas) { @@ -355,11 +355,14 @@ namespace FlaxEditor.Viewport if (canvas != null) { if (canvas.Is2D) - { continue; - } } } + else if (a is UICanvas uiCanvas) + { + if (uiCanvas.Is2D) + continue; + } // Check if all corners are in box to select it. var corners = actorBox.GetCorners();