Drop normalized_get_direction, use physical distances instead

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2017-01-23 10:43:04 +10:00
parent 33d708e2de
commit a64f9df5ce
3 changed files with 4 additions and 7 deletions

View file

@ -185,7 +185,6 @@ static uint32_t
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 */
@ -198,9 +197,7 @@ tp_gesture_get_direction(struct tp_dispatch *tp, struct tp_touch *touch,
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

View file

@ -623,7 +623,7 @@ tp_palm_detect_move_out_of_edge(struct tp_dispatch *tp,
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;
}

View file

@ -763,9 +763,9 @@ xy_get_direction(double x, double y)
}
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);
}
/**