diff options
author | Jason Gerecke <killertofu@gmail.com> | 2018-06-25 14:54:41 -0700 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2019-09-04 09:43:04 -0700 |
commit | 3cf2348aa5b3cb169a0b9d5ce06a243dcd009e0c (patch) | |
tree | a063daf01719543a6b99c7b6aeaa7eddff10a20c | |
parent | 73c0fdb41eeea00667029d5eea1129c0ad14e17e (diff) | |
download | xf86-input-wacom-3cf2348aa5b3cb169a0b9d5ce06a243dcd009e0c.tar.gz |
Revert "Reset wcmGestureState to current device state upon gesture start"
This reverts commit 8f85692a19bd34dae77071a296a14c01a491cf4a.
In the next commit we will be starting gestures immediately on detection,
eliminating the need for this commit. (Indeed, its existance actually
is an additional delay of 1 event distance to immediate execution)
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmTouchFilter.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index c23b47e..bbbcfcf 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -639,7 +639,6 @@ static void wcmFingerScroll(WacomDevicePtr priv) int i = 0, dist = 0; WacomFilterState filterd; /* borrow this struct */ int max_spread = common->wcmGestureParameters.wcmMaxScrollFingerSpread; - int gestureStart = 0; int spread; if (!common->wcmGesture) @@ -666,7 +665,6 @@ static void wcmFingerScroll(WacomDevicePtr priv) /* left button might be down. Send it up first */ wcmSendButtonClick(priv, 1, 0); common->wcmGestureMode = GESTURE_SCROLL_MODE; - gestureStart = 1; } } } @@ -675,13 +673,6 @@ static void wcmFingerScroll(WacomDevicePtr priv) if (common->wcmGestureMode != GESTURE_SCROLL_MODE) return; - /* forget history leading up to the beginning of the gesture */ - if (gestureStart) - { - common->wcmGestureState[0] = ds[0]; - common->wcmGestureState[1] = ds[1]; - } - /* initialize the points so we can rotate them */ filterd.x[0] = ds[0].x; filterd.y[0] = ds[0].y; @@ -748,9 +739,9 @@ static void wcmFingerZoom(WacomDevicePtr priv) WacomDeviceState ds[2] = {}; WacomDeviceState *start = common->wcmGestureState; int count, button; - int dist; + int dist = touchDistance(common->wcmGestureState[0], + common->wcmGestureState[1]); int max_spread = common->wcmGestureParameters.wcmMaxScrollFingerSpread; - int gestureStart = 0; int spread; if (!common->wcmGesture) @@ -773,21 +764,13 @@ static void wcmFingerZoom(WacomDevicePtr priv) /* fingers moved apart more than 3 times * wcmMaxScrollFingerSpread, zoom mode is entered */ common->wcmGestureMode = GESTURE_ZOOM_MODE; - gestureStart = 1; } } if (common->wcmGestureMode != GESTURE_ZOOM_MODE) return; - /* forget history leading up to the beginning of the gesture */ - if (gestureStart) - { - common->wcmGestureState[0] = ds[0]; - common->wcmGestureState[1] = ds[1]; - } - - dist = touchDistance(ds[0], ds[1]) - touchDistance(common->wcmGestureState[0], common->wcmGestureState[1]); + dist = touchDistance(ds[0], ds[1]) - dist; count = (int)((1.0 * abs(dist)/common->wcmGestureParameters.wcmZoomDistance) + 0.5); /* user might have changed from left to right or vice versa */ |