summaryrefslogtreecommitdiff
path: root/src/gestures-pinch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gestures-pinch.c')
-rw-r--r--src/gestures-pinch.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c
index 3b94a66..18007de 100644
--- a/src/gestures-pinch.c
+++ b/src/gestures-pinch.c
@@ -35,17 +35,25 @@ static const int getype[DIM_TOUCH + 1] = {
35 35
36static const int fm_mask = 0x04; 36static const int fm_mask = 0x04;
37 37
38static void set_props(struct combo_model *s, const struct move_model *m)
39{
40 s->prop[GRAIL_PROP_PINCH_DR] = m->fm[FM_R].action_delta;
41 s->prop[GRAIL_PROP_PINCH_VR] = m->fm[FM_R].velocity;
42 s->prop[GRAIL_PROP_PINCH_R] = m->fm[FM_R].value;
43 s->nprop = 3;
44}
45
38int gru_pinch(struct grail *ge, 46int gru_pinch(struct grail *ge,
39 const struct touch_frame *frame) 47 const struct touch_frame *frame)
40{ 48{
41 struct gesture_recognizer *gru = ge->gru; 49 struct gesture_recognizer *gru = ge->gru;
42 struct combo_model *state = &gru->pinch; 50 struct combo_model *state = &gru->pinch;
43 struct move_model *move = &gru->move; 51 struct move_model *move = &gru->move;
44 grail_prop_t prop[DIM_GRAIL_PROP];
45 int mask = state->active ? (move->active & fm_mask) : fm_mask; 52 int mask = state->active ? (move->active & fm_mask) : fm_mask;
46 if (!move->multi) { 53 if (!move->multi) {
47 if (state->active) { 54 if (state->active) {
48 gru_end(ge, state->gid, move); 55 gru_end(ge, state->gid, move,
56 state->prop, state->nprop);
49 state->active = 0; 57 state->active = 0;
50 } 58 }
51 return 0; 59 return 0;
@@ -61,7 +69,7 @@ int gru_pinch(struct grail *ge,
61 } 69 }
62 if (!(move->active & fm_mask)) 70 if (!(move->active & fm_mask))
63 return 0; 71 return 0;
64 prop[0] = move->fm[FM_R].action_delta; 72 set_props(state, move);
65 gru_event(ge, state->gid, move, prop, 1); 73 gru_event(ge, state->gid, move, state->prop, state->nprop);
66 return 1; 74 return 1;
67} 75}