#define ELM_GESTURE_NEGATIVE_ANGLE (-1.0) /* Magic number */
#define ELM_GESTURE_MOMENTUM_TIMEOUT 50
#define ELM_GESTURE_MULTI_TIMEOUT 50
+#define ELM_GESTURE_MINIMUM_MOMENTUM 0.001
/* Some Trigo values */
#define RAD_90DEG M_PI_2
Gesture_Info *gesture = wd->gesture[g_type];
if (!gesture ) return;
+ /* When continues enable = TRUE a gesture may START on MOVE event */
+ /* We don't allow this to happen with the if-statement below. */
+ /* When continues enable = FALSE a gesture may START on DOWN only */
+ /* Therefor it would NOT start on MOVE event. */
+ /* NOTE that touched list is updated AFTER this function returns */
+ /* so (count == 0) when we get here on first touch on surface. */
if ((wd->glayer_continues_enable) && (!eina_list_count(wd->touched)))
return; /* Got move on mouse-over move */
_set_momentum(&st->info, st->line_st.x, st->line_st.y, pe_local.x, pe_local.y,
st->t_st_x, st->t_st_y, pe_local.timestamp);
- ev_flag = _set_state(gesture, ELM_GESTURE_STATE_END, &st->info,
+ if ((fabs(st->info.mx) > ELM_GESTURE_MINIMUM_MOMENTUM) ||
+ (fabs(st->info.my) > ELM_GESTURE_MINIMUM_MOMENTUM))
+ state_to_report = ELM_GESTURE_STATE_END;
+ else
+ state_to_report = ELM_GESTURE_STATE_ABORT;
+
+ ev_flag = _set_state(gesture, state_to_report, &st->info,
EINA_FALSE);
consume_event(wd, event_info, event_type, ev_flag);
return;
Gesture_Info *gesture = wd->gesture[g_type];
if (!gesture ) return;
+ /* When continues enable = TRUE a gesture may START on MOVE event */
+ /* We don't allow this to happen with the if-statement below. */
+ /* When continues enable = FALSE a gesture may START on DOWN only */
+ /* Therefor it would NOT start on MOVE event. */
+ /* NOTE that touched list is updated AFTER this function returns */
+ /* so (count == 0) when we get here on first touch on surface. */
if ((wd->glayer_continues_enable) && (!eina_list_count(wd->touched)))
return; /* Got move on mouse-over move */