diff --git a/druid/base/drag.lua b/druid/base/drag.lua index 2eef901..7625c29 100644 --- a/druid/base/drag.lua +++ b/druid/base/drag.lua @@ -71,8 +71,10 @@ local function end_touch(self) end self.is_drag = false - self.is_touch = false - self.on_touch_end:trigger(self:get_context()) + if self.is_touch then + self.is_touch = false + self.on_touch_end:trigger(self:get_context()) + end self:reset_input_priority() self.touch_id = 0 end diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 8f5cac9..a01b904 100644 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -569,11 +569,11 @@ end function Scroll._check_threshold(self) 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 self.inertion.x = 0 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 self.inertion.y = 0 end