summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gestures-rotate.c16
1 files changed, 13 insertions, 3 deletions
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] = {
35 35
36static const int fm_mask = 0x08; 36static const int fm_mask = 0x08;
37 37
38static void set_props(struct combo_model *s, const struct move_model *m) 38static void set_props(struct combo_model *s, const struct move_model *m,
39 const struct touch_frame *frame)
39{ 40{
41 struct grail_coord min, max;
40 s->prop[GRAIL_PROP_ROTATE_DA] = m->fm[FM_A].action_delta; 42 s->prop[GRAIL_PROP_ROTATE_DA] = m->fm[FM_A].action_delta;
41 s->prop[GRAIL_PROP_ROTATE_VA] = m->fm[FM_A].velocity; 43 s->prop[GRAIL_PROP_ROTATE_VA] = m->fm[FM_A].velocity;
42 s->prop[GRAIL_PROP_ROTATE_A] = m->fm[FM_A].value; 44 s->prop[GRAIL_PROP_ROTATE_A] = m->fm[FM_A].value;
43 s->nprop = 3; 45 s->nprop = 3;
46 if (!frame->nactive)
47 return;
48 gru_compute_bbox(&min, &max, frame);
49 s->prop[GRAIL_PROP_ROTATE_X1] = min.x;
50 s->prop[GRAIL_PROP_ROTATE_Y1] = min.y;
51 s->prop[GRAIL_PROP_ROTATE_X2] = max.x;
52 s->prop[GRAIL_PROP_ROTATE_Y2] = max.y;
53 s->nprop = 7;
44} 54}
45 55
46int gru_rotate(struct grail *ge, 56int gru_rotate(struct grail *ge,
@@ -69,7 +79,7 @@ int gru_rotate(struct grail *ge,
69 } 79 }
70 if (!(move->active & fm_mask)) 80 if (!(move->active & fm_mask))
71 return 0; 81 return 0;
72 set_props(state, move); 82 set_props(state, move, frame);
73 gru_event(ge, state->gid, move, state->prop, state->nprop); 83 gru_event(ge, state->gid, move, state->prop, state->nprop);
74 return 1; 84 return 1;
75} 85}
@@ -110,7 +120,7 @@ int gru_winrotate(struct grail *ge,
110 } 120 }
111 if (!(move->active & fm_mask)) 121 if (!(move->active & fm_mask))
112 return 0; 122 return 0;
113 set_props(state, move); 123 set_props(state, move, frame);
114 gru_event(ge, state->gid, move, state->prop, state->nprop); 124 gru_event(ge, state->gid, move, state->prop, state->nprop);
115 return 1; 125 return 1;
116} 126}