From 0080c0de7839cbd036f9c2eefcbe4e6c10169fba Mon Sep 17 00:00:00 2001 From: Rene Horn Date: Sat, 8 Dec 2012 11:04:33 -0600 Subject: [PATCH] Added a check for horizontal scrolling for sxd for if we are actually scrolling horizontally. --- kivy/uix/scrollview.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kivy/uix/scrollview.py b/kivy/uix/scrollview.py index 3eeb44c84..4adb74873 100644 --- a/kivy/uix/scrollview.py +++ b/kivy/uix/scrollview.py @@ -368,11 +368,12 @@ class ScrollView(StencilView): sxd = self._scroll_x_mouse - d elif touch.button == 'scrollleft': sxd = self._scroll_x_mouse + d - self._scroll_x_mouse = scroll_x = min(max(sxd, 0), 1) - Animation.stop_all(self, 'scroll_x') - Animation(scroll_x=scroll_x, d=.3, t='out_quart').start(self) - Clock.unschedule(self._update_animation) - return True + if sxd is not None: + self._scroll_x_mouse = scroll_x = min(max(sxd, 0), 1) + Animation.stop_all(self, 'scroll_x') + Animation(scroll_x=scroll_x, d=.3, t='out_quart').start(self) + Clock.unschedule(self._update_animation) + return True self._touch = touch uid = self._get_uid()