Ensure we are not overwflowing target position

This commit is contained in:
Marco Pesenti Gritti 2006-07-07 17:18:21 +02:00
parent 63c93e4f2d
commit 1b6e8b4480

View File

@ -47,7 +47,9 @@ class SlidingHelper:
self._cur_time = time.time() self._cur_time = time.time()
remaining = self._target_time - self._cur_time remaining = self._target_time - self._cur_time
if remaining <= 0: if remaining <= 0 or \
(y > self._target_y and self._direction == SlidingHelper.IN) or \
(y < self._target_y and self._direction == SlidingHelper.OUT):
self._end = True self._end = True
y = self._orig_y y = self._orig_y
else: else: