From a73179326ed8fda9588b8650209bd230957c2876 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 11 Aug 2010 17:31:55 +0100 Subject: api: add bounding box to rotate gestures Signed-off-by: Henrik Rydberg --- src/gestures-rotate.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c index 5763294..23bbfd6 100644 --- a/src/gestures-rotate.c +++ b/src/gestures-rotate.c @@ -35,12 +35,22 @@ static const int getype[DIM_TOUCH + 1] = { static const int fm_mask = 0x08; -static void set_props(struct combo_model *s, const struct move_model *m) +static void set_props(struct combo_model *s, const struct move_model *m, + const struct touch_frame *frame) { + struct grail_coord min, max; s->prop[GRAIL_PROP_ROTATE_DA] = m->fm[FM_A].action_delta; s->prop[GRAIL_PROP_ROTATE_VA] = m->fm[FM_A].velocity; s->prop[GRAIL_PROP_ROTATE_A] = m->fm[FM_A].value; s->nprop = 3; + if (!frame->nactive) + return; + gru_compute_bbox(&min, &max, frame); + s->prop[GRAIL_PROP_ROTATE_X1] = min.x; + s->prop[GRAIL_PROP_ROTATE_Y1] = min.y; + s->prop[GRAIL_PROP_ROTATE_X2] = max.x; + s->prop[GRAIL_PROP_ROTATE_Y2] = max.y; + s->nprop = 7; } int gru_rotate(struct grail *ge, @@ -69,7 +79,7 @@ int gru_rotate(struct grail *ge, } if (!(move->active & fm_mask)) return 0; - set_props(state, move); + set_props(state, move, frame); gru_event(ge, state->gid, move, state->prop, state->nprop); return 1; } @@ -110,7 +120,7 @@ int gru_winrotate(struct grail *ge, } if (!(move->active & fm_mask)) return 0; - set_props(state, move); + set_props(state, move, frame); gru_event(ge, state->gid, move, state->prop, state->nprop); return 1; } -- cgit v1.2.3