Merge pull request #389 from chrox/master

add PAN_THRESHOLD when detecting hold_pan gesture
This commit is contained in:
Qingping Hou
2013-12-08 21:15:20 -08:00

View File

@@ -559,7 +559,8 @@ function GestureDetector:holdState(tev, hold)
},
time = tev.timev,
}
else
elseif (tev.x and math.abs(tev.x - self.first_tevs[slot].x) >= self.PAN_THRESHOLD) or
(tev.y and math.abs(tev.y - self.first_tevs[slot].y) >= self.PAN_THRESHOLD) then
local ges_ev = self:handlePan(tev)
if ges_ev ~= nil then ges_ev.ges = "hold_pan" end
return ges_ev