From aca552224580009b3ce129cdcb496c2c55e0eb70 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Wed, 5 Oct 2022 21:16:54 -0500 Subject: [PATCH] Fixed small bug when moving a tab when close to the split panel splitter --- Source/Engine/UI/GUI/Panels/SplitPanel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Panels/SplitPanel.cs b/Source/Engine/UI/GUI/Panels/SplitPanel.cs index 4b15c38db..65ef60a19 100644 --- a/Source/Engine/UI/GUI/Panels/SplitPanel.cs +++ b/Source/Engine/UI/GUI/Panels/SplitPanel.cs @@ -24,6 +24,7 @@ namespace FlaxEngine.GUI private Rectangle _splitterRect; private bool _splitterClicked, _mouseOverSplitter; private bool _cursorChanged; + private bool _anyMouseButtonDown; /// /// The first panel (left or upper based on Orientation). @@ -163,8 +164,9 @@ namespace FlaxEngine.GUI { SplitterValue = _orientation == Orientation.Horizontal ? location.X / Width : location.Y / Height; Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS; + _cursorChanged = true; } - else if (_mouseOverSplitter) + else if (_mouseOverSplitter && !_anyMouseButtonDown) { Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS; _cursorChanged = true; @@ -181,6 +183,7 @@ namespace FlaxEngine.GUI /// public override bool OnMouseDown(Float2 location, MouseButton button) { + _anyMouseButtonDown = true; if (button == MouseButton.Left && _splitterRect.Contains(location)) { // Start moving splitter @@ -195,6 +198,7 @@ namespace FlaxEngine.GUI /// public override bool OnMouseUp(Float2 location, MouseButton button) { + _anyMouseButtonDown = false; if (_splitterClicked) { EndTracking();