don't trigger mode change when carousel is being slided already

This commit is contained in:
Atis 2016-08-13 18:22:15 +03:00 committed by gabriel pettier
parent e7f81e3ccb
commit 17319bf9ee
1 changed files with 10 additions and 8 deletions

View File

@ -529,14 +529,16 @@ class Carousel(StencilView):
def on_touch_move(self, touch):
if self.touch_mode_change == False:
if self.ignore_perpendicular_swipes and self.direction in ('top', 'bottom'):
if abs(touch.ox - touch.x) > self.scroll_distance:
self._change_touch_mode()
self.touchModeChange = True
elif self.ignore_perpendicular_swipes and self.direction in ('right', 'left'):
if abs(touch.oy - touch.y) > self.scroll_distance:
self._change_touch_mode()
self.touchModeChange = True
if self.ignore_perpendicular_swipes and self.direction in ('top','bottom'):
if abs(touch.oy - touch.y) < self.scroll_distance:
if abs(touch.ox - touch.x) > self.scroll_distance:
self._change_touch_mode()
self.touchModeChange = True
elif self.ignore_perpendicular_swipes and self.direction in ('right','left'):
if abs(touch.ox - touch.x) < self.scroll_distance:
if abs(touch.oy - touch.y) > self.scroll_distance:
self._change_touch_mode()
self.touchModeChange = True
if self._get_uid('cavoid') in touch.ud:
return