OSDN Git Service

Added cancel() to GestureDetector.
authorNathanSweet <nathan.sweet@gmail.com>
Thu, 26 Sep 2013 07:30:38 +0000 (09:30 +0200)
committerNathanSweet <nathan.sweet@gmail.com>
Thu, 26 Sep 2013 07:30:38 +0000 (09:30 +0200)
http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=10945

gdx/src/com/badlogic/gdx/input/GestureDetector.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java

index e854883..8fc4705 100644 (file)
@@ -224,6 +224,11 @@ public class GestureDetector extends InputAdapter {
                return handled;\r
        }\r
 \r
+       /** No further gesture events will be triggered for the current touch, if any. */\r
+       public void cancel () {\r
+               longPressFired = true;\r
+       }\r
+\r
        /** @return whether the user touched the screen long enough to trigger a long press event. */\r
        public boolean isLongPressed () {\r
                return isLongPressed(longPressSeconds);\r
index 191d77f..6ca7410 100644 (file)
@@ -236,6 +236,7 @@ public class ScrollPane extends WidgetGroup {
                draggingPointer = -1;\r
                touchScrollH = false;\r
                touchScrollV = false;\r
+               flickScrollListener.getGestureDetector().cancel();\r
        }\r
 \r
        void clamp () {\r