summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-edge-scroll.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-03-24 13:14:18 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2015-03-25 09:18:55 +1000
commitfe93145f8653a3f3136445768a1e84bcce903d84 (patch)
treeb3a0748448e84faf01126c9eccb448bdfbb9dac2 /src/evdev-mt-touchpad-edge-scroll.c
parent61721e446a28f741b6143e0fbde1fd2ae48263e0 (diff)
Add a delta_coords type and use it were applicable
tp_normalize_coords is one of the last functions taking separate x, y values rather a coordinate pair, this commit cleans this up. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-mt-touchpad-edge-scroll.c')
-rw-r--r--src/evdev-mt-touchpad-edge-scroll.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index d304316..91ebd28 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -313,7 +313,6 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
struct tp_touch *t;
enum libinput_pointer_axis axis;
double *delta;
- double initial_dx, initial_dy;
struct normalized_coords normalized;
const struct normalized_coords zero = { 0.0, 0.0 };
const struct discrete_coords zero_discrete = { 0.0, 0.0 };
@@ -361,12 +360,9 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
t->scroll.edge_state);
break;
case EDGE_SCROLL_TOUCH_STATE_EDGE_NEW:
- initial_dx = t->point.x - t->scroll.initial.x;
- initial_dy = t->point.y - t->scroll.initial.y;
- tp_normalize_delta(tp,
- initial_dx,
- initial_dy,
- &normalized);
+ normalized = tp_normalize_delta(tp,
+ device_delta(t->point,
+ t->scroll.initial));
if (fabs(*delta) < DEFAULT_SCROLL_THRESHOLD)
normalized = zero;
break;