From bd6de84f931f55d32273e94f7fbe1785f7bac39b Mon Sep 17 00:00:00 2001 From: Sinai Date: Thu, 22 Apr 2021 20:11:27 +1000 Subject: [PATCH] Prevent dragging/resizing panels underneath the focused panel --- src/UI/Utility/PanelDragger.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/UI/Utility/PanelDragger.cs b/src/UI/Utility/PanelDragger.cs index c07a5d3..ae5fb00 100644 --- a/src/UI/Utility/PanelDragger.cs +++ b/src/UI/Utility/PanelDragger.cs @@ -46,10 +46,12 @@ namespace UnityExplorer.UI.Utility else state = MouseState.NotPressed; + var mousePos = InputManager.MousePosition; + handledInstanceThisFrame = false; foreach (var instance in Instances) { - instance.Update(state, InputManager.MousePosition); + instance.Update(state, mousePos); if (handledInstanceThisFrame) break; } @@ -162,9 +164,10 @@ namespace UnityExplorer.UI.Utility OnEndResize(); handledInstanceThisFrame = true; } - else if (!inDragPos && MouseInResizeArea(resizePos) && (type = GetResizeType(resizePos)) != ResizeTypes.NONE) + else if (!inDragPos && MouseInResizeArea(resizePos)) { - OnHoverResize(type); + if ((type = GetResizeType(resizePos)) != ResizeTypes.NONE) + OnHoverResize(type); handledInstanceThisFrame = true; } else if (WasHoveringResize)