From 3efb981f00be75f8b82d45791a5935cc9e93713c Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 18 Nov 2025 16:51:43 +0100 Subject: [PATCH] Fix rare issues on input bugs in Visject --- Source/Editor/Surface/VisjectSurface.Input.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Editor/Surface/VisjectSurface.Input.cs b/Source/Editor/Surface/VisjectSurface.Input.cs index 51fd96ad6..cbc041c09 100644 --- a/Source/Editor/Surface/VisjectSurface.Input.cs +++ b/Source/Editor/Surface/VisjectSurface.Input.cs @@ -469,7 +469,8 @@ namespace FlaxEditor.Surface bool handled = base.OnMouseDown(location, button); if (!handled) CustomMouseDown?.Invoke(ref location, button, ref handled); - if (handled) + var root = Root; + if (handled || root == null) { // Clear flags _isMovingSelection = false; @@ -523,11 +524,11 @@ namespace FlaxEditor.Surface if (_leftMouseDown && controlUnderMouse.CanSelect(ref cLocation)) { // Check if user is pressing control - if (Root.GetKey(KeyboardKeys.Control)) + if (root.GetKey(KeyboardKeys.Control)) { AddToSelection(controlUnderMouse); } - else if (Root.GetKey(KeyboardKeys.Shift)) + else if (root.GetKey(KeyboardKeys.Shift)) { RemoveFromSelection(controlUnderMouse); } @@ -539,7 +540,7 @@ namespace FlaxEditor.Surface } // Start moving selected nodes - if (!Root.GetKey(KeyboardKeys.Shift)) + if (!root.GetKey(KeyboardKeys.Shift)) { StartMouseCapture(); _movingSelectionViewPos = _rootControl.Location; @@ -559,7 +560,7 @@ namespace FlaxEditor.Surface // Start selecting or commenting StartMouseCapture(); - if (!Root.GetKey(KeyboardKeys.Control) && !Root.GetKey(KeyboardKeys.Shift)) + if (!root.GetKey(KeyboardKeys.Control) && !root.GetKey(KeyboardKeys.Shift)) { ClearSelection(); }