Просмотр исходного кода

* Fix issue 520 again: pressing mouse over jme and releasing over nifty did not tell jme about the release.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9615 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..rd 13 лет назад
Родитель
Сommit
be58274ab8
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

+ 3 - 4
engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

@@ -132,10 +132,9 @@ public class InputSystemJme implements InputSystem, RawInputListener {
             // Forward the event if nifty owns it or if the cursor is visible.
             if (niftyOwnsDragging[button] || inputManager.isCursorVisible()){
                 boolean consumed = nic.processMouseEvent(x, y, 0, button, false);
-                // TODO: nifty must always consume up event when it consumes down event!
-                // Otherwise jME3 will see a mouse up event
-                // without a mouse down event!
-                if (consumed) {
+                
+                // Only consume event if it ORIGINATED in nifty!
+                if (niftyOwnsDragging[button] && consumed) {
                     evt.setConsumed();
                     processSoftKeyboard();
                 }