mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] TimeVal: add dbg:guard against incorrect subtraction order (#4669)
In principle, any negative subtraction result should be caused by a logical error.
This commit is contained in:
@@ -195,7 +195,7 @@ end
|
||||
|
||||
function GestureDetector:isSwipe(slot)
|
||||
if not self.first_tevs[slot] or not self.last_tevs[slot] then return end
|
||||
local tv_diff = self.first_tevs[slot].timev - self.last_tevs[slot].timev
|
||||
local tv_diff = self.last_tevs[slot].timev - self.first_tevs[slot].timev
|
||||
if (tv_diff.sec == 0) and (tv_diff.usec < self.SWIPE_INTERVAL) then
|
||||
local x_diff = self.last_tevs[slot].x - self.first_tevs[slot].x
|
||||
local y_diff = self.last_tevs[slot].y - self.first_tevs[slot].y
|
||||
|
||||
Reference in New Issue
Block a user