tp_gesture_get_direction(struct tp_dispatch *tp, struct tp_touch *touch,
unsigned int nfingers)
{
- struct normalized_coords normalized;
struct phys_coords mm;
struct device_float_coords delta;
double move_threshold = 1.0; /* mm */
if (length_in_mm(mm) < move_threshold)
return UNDEFINED_DIRECTION;
- normalized = tp_normalize_delta(tp, delta);
-
- return normalized_get_direction(normalized);
+ return phys_get_direction(mm);
}
static void
if (time < t->palm.time + PALM_TIMEOUT &&
(t->point.x > tp->palm.left_edge && t->point.x < tp->palm.right_edge)) {
delta = device_delta(t->point, t->palm.first);
- dirs = normalized_get_direction(tp_normalize_delta(tp, delta));
+ dirs = phys_get_direction(tp_phys_delta(tp, delta));
if ((dirs & DIRECTIONS) && !(dirs & ~DIRECTIONS))
return true;
}
}
static inline uint32_t
-normalized_get_direction(struct normalized_coords norm)
+phys_get_direction(struct phys_coords mm)
{
- return xy_get_direction(norm.x, norm.y);
+ return xy_get_direction(mm.x, mm.y);
}
/**