Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit cccd022

Browse files
committed
Force stop panel drag/resize when starting Inspect Under Mouse
1 parent 83f15c7 commit cccd022

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/UI/Inspectors/InspectUnderMouse.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public void StartInspect(MouseInspectMode mode)
7171
if (!MainCamera)
7272
return;
7373

74+
PanelDragger.ForceEnd();
75+
7476
Mode = mode;
7577
Inspecting = true;
7678
UIManager.NavBarRect.gameObject.SetActive(false);

src/UI/Panels/PanelDragger.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ public class PanelDragger
1717

1818
public static bool Resizing { get; private set; }
1919

20+
public static bool ResizePrompting => s_resizeCursorObj && s_resizeCursorObj.activeSelf;
21+
22+
internal static void ForceEnd()
23+
{
24+
s_resizeCursorObj.SetActive(false);
25+
wasAnyDragging = false;
26+
27+
foreach (var instance in Instances)
28+
{
29+
instance.WasDragging = false;
30+
instance.WasResizing = false;
31+
}
32+
}
33+
2034
internal static List<PanelDragger> Instances = new List<PanelDragger>();
2135

2236
static PanelDragger()
@@ -82,7 +96,6 @@ public static void UpdateInstances()
8296

8397
#endregion
8498

85-
public static bool ResizePrompting => s_resizeCursorObj && s_resizeCursorObj.activeSelf;
8699
public static GameObject s_resizeCursorObj;
87100

88101
internal static bool wasAnyDragging;

0 commit comments

Comments
 (0)