]> git.tdb.fi Git - libs/gui.git/commitdiff
Alter the starting condition for gestures
authorMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 21:18:05 +0000 (23:18 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 21:18:05 +0000 (23:18 +0200)
This makes pinch and rotate in particular easier to perform.

source/input/gesturedetector.cpp

index 62ac3f050d09c9c849b7e0c6c62ecf8e3185a3bf..97e3d56f0fc53a3e4a7eb0e271a2a0c060303603 100644 (file)
@@ -150,11 +150,12 @@ void GestureDetector::start_gesture()
        if(!p.down)
                return;
 
-       /* At least one point needs to have moved more than the threshold to start
-       the gesture. */
-       bool threshold_exceeded = false;
-       for(unsigned i=0; (i<MAX_POINTS && !threshold_exceeded); ++i)
-               threshold_exceeded = (points[i].down && points[i].threshold_exceeded);
+       /* All held points need to have moved more than the threshold to start the
+       gesture. */
+       bool threshold_exceeded = true;
+       for(unsigned i=0; (i<MAX_POINTS && threshold_exceeded); ++i)
+               if(points[i].down && !points[i].threshold_exceeded)
+                       threshold_exceeded = false;
        if(!threshold_exceeded)
                return;