Better on end touch events

This commit is contained in:
Insality 2021-02-07 13:14:30 +05:00
parent 7ac6c9b02b
commit 8a173305de
2 changed files with 6 additions and 4 deletions

View File

@ -71,8 +71,10 @@ local function end_touch(self)
end end
self.is_drag = false self.is_drag = false
self.is_touch = false if self.is_touch then
self.on_touch_end:trigger(self:get_context()) self.is_touch = false
self.on_touch_end:trigger(self:get_context())
end
self:reset_input_priority() self:reset_input_priority()
self.touch_id = 0 self.touch_id = 0
end end

View File

@ -569,11 +569,11 @@ end
function Scroll._check_threshold(self) function Scroll._check_threshold(self)
local is_stopped = false local is_stopped = false
if self.inertion.x ~= 0 and math.abs(self.inertion.x) < self.style.INERT_THRESHOLD then if math.abs(self.inertion.x) < self.style.INERT_THRESHOLD then
is_stopped = true is_stopped = true
self.inertion.x = 0 self.inertion.x = 0
end end
if self.inertion.y ~= 0 and math.abs(self.inertion.y) < self.style.INERT_THRESHOLD then if math.abs(self.inertion.y) < self.style.INERT_THRESHOLD then
is_stopped = true is_stopped = true
self.inertion.y = 0 self.inertion.y = 0
end end