From 172241bc8e51d5860ef142f0fd46d219f39fef36 Mon Sep 17 00:00:00 2001 From: Giorgio Micotti Date: Tue, 7 Jan 2014 23:10:10 +0100 Subject: [PATCH] Fix corner case for Kobo Aura: tev.id == -1 with tev.x and tev.y values defined. --- frontend/ui/gesturedetector.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/ui/gesturedetector.lua b/frontend/ui/gesturedetector.lua index 1a334527a..a299b6181 100644 --- a/frontend/ui/gesturedetector.lua +++ b/frontend/ui/gesturedetector.lua @@ -209,20 +209,20 @@ end function GestureDetector:initialState(tev) local slot = tev.slot if tev.id then - -- a event ends + -- an event ends if tev.id == -1 then self.detectings[slot] = false else self.track_ids[slot] = tev.id - end - end - if tev.x and tev.y then - -- user starts a new touch motion - if not self.detectings[slot] then - self.detectings[slot] = true - self.first_tevs[slot] = self:deepCopyEv(tev) - -- default to tap state - return self:switchState("tapState", tev) + if tev.x and tev.y then + -- user starts a new touch motion + if not self.detectings[slot] then + self.detectings[slot] = true + self.first_tevs[slot] = self:deepCopyEv(tev) + -- default to tap state + return self:switchState("tapState", tev) + end + end end end end