Browse Source

Do not mouse scroll the camera view when cursor is over a UI element because the element may be taking the wheel input also.

Lasse Öörni 12 years ago
parent
commit
25cdbaea97
2 changed files with 3 additions and 3 deletions
  1. 1 1
      Bin/Data/Scripts/Editor/EditorView.as
  2. 2 2
      Source/Engine/UI/UI.h

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

@@ -875,7 +875,7 @@ void UpdateView(float timeStep)
             cameraNode.Translate(Vector3(0, -cameraBaseSpeed, 0) * timeStep * speedMultiplier);
             FadeUI();
         }
-        if (input.mouseMoveWheel != 0)
+        if (input.mouseMoveWheel != 0 && ui.GetElementAt(ui.cursor.position) is null)
             cameraNode.TranslateRelative(Vector3(0, 0, -cameraBaseSpeed) * -input.mouseMoveWheel*20 * timeStep * speedMultiplier);
     }
 

+ 2 - 2
Source/Engine/UI/UI.h

@@ -104,9 +104,9 @@ public:
     Cursor* GetCursor() const { return cursor_; }
     /// Return cursor position.
     IntVector2 GetCursorPosition() const;
-    /// Return UI element at screen coordinates.
+    /// Return UI element at screen coordinates. By default returns only input-enabled elements.
     UIElement* GetElementAt(const IntVector2& position, bool enabledOnly = true);
-    /// Return UI element at screen coordinates.
+    /// Return UI element at screen coordinates. By default returns only input-enabled elements.
     UIElement* GetElementAt(int x, int y, bool enabledOnly = true);
     /// Return focused element.
     UIElement* GetFocusElement() const { return focusElement_; }