Browse Source

Clear drag object on mouse up

Josh Engebretson 10 years ago
parent
commit
b1ada0f5e1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Script/AtomicEditor/ui/frames/HierarchyFrame.ts

+ 7 - 0
Script/AtomicEditor/ui/frames/HierarchyFrame.ts

@@ -49,6 +49,13 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
         // handle dropping on hierarchy, moving node, dropping prefabs, etc
         // handle dropping on hierarchy, moving node, dropping prefabs, etc
         this.subscribeToEvent(this.hierList.rootList, "DragEnded", (data) => this.handleDragEnded(data));
         this.subscribeToEvent(this.hierList.rootList, "DragEnded", (data) => this.handleDragEnded(data));
+        // on mouse up clear the list's drag object
+        this.subscribeToEvent("MouseButtonUp", () => {
+
+          this.hierList.rootList.dragObject = null;
+
+        });
+
 
 
         this.subscribeToEvent(EditorEvents.SceneClosed, (ev: EditorEvents.SceneClosedEvent) => {
         this.subscribeToEvent(EditorEvents.SceneClosed, (ev: EditorEvents.SceneClosedEvent) => {