diff options
Diffstat (limited to 'src/gestures-pinch.c')
| -rw-r--r-- | src/gestures-pinch.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index 91e6504..d05b06f 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c | |||
| @@ -39,34 +39,18 @@ static void set_props(struct combo_model *s, | |||
| 39 | const struct move_model *m, | 39 | const struct move_model *m, |
| 40 | const struct touch_frame *frame) | 40 | const struct touch_frame *frame) |
| 41 | { | 41 | { |
| 42 | float x1, y1, x2, y2, x, y; | 42 | struct grail_coord min, max; |
| 43 | int i; | ||
| 44 | s->prop[GRAIL_PROP_PINCH_DR] = m->fm[FM_R].action_delta; | 43 | s->prop[GRAIL_PROP_PINCH_DR] = m->fm[FM_R].action_delta; |
| 45 | s->prop[GRAIL_PROP_PINCH_VR] = m->fm[FM_R].velocity; | 44 | s->prop[GRAIL_PROP_PINCH_VR] = m->fm[FM_R].velocity; |
| 46 | s->prop[GRAIL_PROP_PINCH_R] = m->fm[FM_R].value; | 45 | s->prop[GRAIL_PROP_PINCH_R] = m->fm[FM_R].value; |
| 47 | s->nprop = 3; | 46 | s->nprop = 3; |
| 48 | if (!frame->nactive) | 47 | if (!frame->nactive) |
| 49 | return; | 48 | return; |
| 50 | x = frame->active[0]->prop[TP_POS_X]; | 49 | gru_compute_bbox(&min, &max, frame); |
| 51 | y = frame->active[0]->prop[TP_POS_Y]; | 50 | s->prop[GRAIL_PROP_PINCH_X1] = min.x; |
| 52 | x1 = x2 = x; | 51 | s->prop[GRAIL_PROP_PINCH_Y1] = min.y; |
| 53 | y1 = y2 = y; | 52 | s->prop[GRAIL_PROP_PINCH_X2] = max.x; |
| 54 | for (i = 1; i < frame->nactive; i++) { | 53 | s->prop[GRAIL_PROP_PINCH_Y2] = max.y; |
| 55 | x = frame->active[i]->prop[TP_POS_X]; | ||
| 56 | y = frame->active[i]->prop[TP_POS_Y]; | ||
| 57 | if (x < x1) | ||
| 58 | x1 = x; | ||
| 59 | if (y < y1) | ||
| 60 | y1 = y; | ||
| 61 | if (x > x2) | ||
| 62 | x2 = x; | ||
| 63 | if (y > y2) | ||
| 64 | y2 = y; | ||
| 65 | } | ||
| 66 | s->prop[GRAIL_PROP_PINCH_X1] = x1; | ||
| 67 | s->prop[GRAIL_PROP_PINCH_Y1] = y1; | ||
| 68 | s->prop[GRAIL_PROP_PINCH_X2] = x2; | ||
| 69 | s->prop[GRAIL_PROP_PINCH_Y2] = y2; | ||
| 70 | s->nprop = 7; | 54 | s->nprop = 7; |
| 71 | } | 55 | } |
| 72 | 56 | ||
