From 3c63b1e6cc9eb7379e7687a5faec778c5dbfdc98 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sun, 8 Aug 2010 11:07:20 +0200 Subject: Keep both raw and action delta in move model Accumulated values can be obtained either by using the raw_delta, which is the actual (filtered) change between frames, or by using the action delta, which sums up to the same position, but in a non- linear fashion. Use the raw delta for pointer gestures. Signed-off-by: Henrik Rydberg --- src/gestures-pan.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gestures-pan.c') diff --git a/src/gestures-pan.c b/src/gestures-pan.c index b8e1751..c951b78 100644 --- a/src/gestures-pan.c +++ b/src/gestures-pan.c @@ -59,10 +59,15 @@ int gru_pan(struct grail *ge, state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); state->active = 1; } - if (!(move->active & fm_mask)) - return 0; - prop[0] = move->fm[FM_X].delta; - prop[1] = move->fm[FM_Y].delta; + if (move->single) { + prop[0] = move->fm[FM_X].raw_delta; + prop[1] = move->fm[FM_Y].raw_delta; + } else { + if (!(move->active & fm_mask)) + return 0; + prop[0] = move->fm[FM_X].action_delta; + prop[1] = move->fm[FM_Y].action_delta; + } gru_event(ge, state->gid, move, prop, 2); return 1; } -- cgit v1.2.3