From b81e52481e025fe8d61af504a1a2a63b2b054cb8 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 18 Aug 2026 02:21:27 +0300 Subject: [PATCH 1/2] Fix mouse capture not ending after connecting Visject boxes --- Source/Editor/Surface/VisjectSurface.Connecting.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Editor/Surface/VisjectSurface.Connecting.cs b/Source/Editor/Surface/VisjectSurface.Connecting.cs index 22616f6ad..621f6105f 100644 --- a/Source/Editor/Surface/VisjectSurface.Connecting.cs +++ b/Source/Editor/Surface/VisjectSurface.Connecting.cs @@ -287,6 +287,7 @@ namespace FlaxEditor.Surface // Reset instigator list _connectionInstigators.Clear(); + EndMouseCapture(); } } } From 7e624da0a1cba2c8bc4de7a7ffdcbc2157de5149 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 18 Aug 2026 02:42:02 +0300 Subject: [PATCH 2/2] Delete Visject surface node when press started over the close button --- Source/Editor/Surface/SurfaceNode.cs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Source/Editor/Surface/SurfaceNode.cs b/Source/Editor/Surface/SurfaceNode.cs index d28d04e1e..b050d5ae2 100644 --- a/Source/Editor/Surface/SurfaceNode.cs +++ b/Source/Editor/Surface/SurfaceNode.cs @@ -76,6 +76,11 @@ namespace FlaxEditor.Surface /// The footer rectangle (local space). /// protected Rectangle _footerRect; + + /// + /// The last mouse down position. + /// + protected Float2 _mouseDownMousePosition; /// /// The node archetype. @@ -163,8 +168,6 @@ namespace FlaxEditor.Surface /// protected virtual Color ArchetypeColor => GroupArchetype.Color; - private Float2 mouseDownMousePosition; - /// /// Calculates the size of the node including header, footer, and margins. /// @@ -1166,10 +1169,9 @@ namespace FlaxEditor.Surface if (base.OnMouseDown(location, button)) return true; + _mouseDownMousePosition = location; if (button == MouseButton.Left && (Archetype.Flags & NodeFlags.NoCloseButton) == 0 && _closeButtonRect.Contains(ref location)) return true; - if (button == MouseButton.Right) - mouseDownMousePosition = Input.Mouse.Position; return false; } @@ -1180,18 +1182,22 @@ namespace FlaxEditor.Surface if (base.OnMouseUp(location, button)) return true; - // Close/ delete - bool canDelete = !Surface.IsConnecting && !Surface.WasSelecting && !Surface.WasMovingSelection; - if (button == MouseButton.Left && canDelete && (Archetype.Flags & NodeFlags.NoCloseButton) == 0 && _closeButtonRect.Contains(ref location)) + if (button == MouseButton.Left) { - Surface.Delete(this); - return true; + // Close/delete + bool canDelete = !Surface.IsConnecting && !Surface.WasSelecting && !Surface.WasMovingSelection; + if (canDelete && (Archetype.Flags & NodeFlags.NoCloseButton) == 0 && + _closeButtonRect.Contains(ref location) && _closeButtonRect.Contains(ref _mouseDownMousePosition)) + { + Surface.Delete(this); + return true; + } } // Secondary Context Menu if (button == MouseButton.Right) { - float distance = Float2.Distance(mouseDownMousePosition, Input.Mouse.Position); + float distance = Float2.Distance(_mouseDownMousePosition, location); if (distance > 2.5f) return true;