summaryrefslogtreecommitdiff
path: root/src/gestures-rotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gestures-rotate.c')
-rw-r--r--src/gestures-rotate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c
index 90f9bdf..6c496d2 100644
--- a/src/gestures-rotate.c
+++ b/src/gestures-rotate.c
@@ -26,6 +26,15 @@
26#include <math.h> 26#include <math.h>
27#include <stdio.h> 27#include <stdio.h>
28 28
29static const int getype[DIM_TOUCH + 1] = {
30 0,
31 0,
32 GRAIL_TYPE_ROTATE,
33 GRAIL_TYPE_TURN,
34 GRAIL_TYPE_WHIRL,
35 GRAIL_TYPE_REVOLVE,
36};
37
29int gru_rotate(struct grail *ge, 38int gru_rotate(struct grail *ge,
30 const struct touch_frame *frame) 39 const struct touch_frame *frame)
31{ 40{
@@ -43,8 +52,7 @@ int gru_rotate(struct grail *ge,
43 if (!move->a.tickle) 52 if (!move->a.tickle)
44 return 0; 53 return 0;
45 if (!state->active) { 54 if (!state->active) {
46 int type = move->ntouch == 2 ? GRAIL_TYPE_ROTATE : 55 int type = getype[move->ntouch];
47 move->ntouch == 3 ? GRAIL_TYPE_TURN : 0;
48 if (!type) 56 if (!type)
49 return 0; 57 return 0;
50 state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); 58 state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame);