Explorar o código

Able to pick non enabled UI-elements as well.

Wei Tjong Yao %!s(int64=12) %!d(string=hai) anos
pai
achega
2d8d3705d7
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Bin/Data/Scripts/Editor/EditorView.as

+ 2 - 2
Bin/Data/Scripts/Editor/EditorView.as

@@ -388,7 +388,7 @@ void ViewRaycast(bool mouseClick)
         return;
 
     IntVector2 pos = ui.cursorPosition;
-    UIElement@ elementAtPos = ui.GetElementAt(pos);
+    UIElement@ elementAtPos = ui.GetElementAt(pos, pickMode != PICK_UI_ELEMENTS);
     if (pickMode == PICK_UI_ELEMENTS)
     {
         bool leftClick = mouseClick && input.mouseButtonPress[MOUSEB_LEFT];
@@ -397,7 +397,7 @@ void ViewRaycast(bool mouseClick)
         if (elementAtPos !is null)
         {
             // Only interested in user-created UI elements
-            if (elementAtPos.GetElementEventSender() is editorUIElement)
+            if (elementAtPos !is editorUIElement && elementAtPos.GetElementEventSender() is editorUIElement)
             {
                 // \todo Debug draw the UIElement
                 //DebugDrawUIElement();