Skip to content

Commit 426fbee

Browse files
committed
animation: fix kivy#1255, from the kivy#1320 pr.
1 parent 45093f3 commit 426fbee

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

kivy/animation.py

-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ def duration(self):
353353

354354
def start(self, widget):
355355
self.stop(widget)
356-
self._widgets[widget.uid] = True
357356
self._register()
358357
self.anim1.start(widget)
359358

kivy/tests/test_animations.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from time import time, sleep
88
from kivy.animation import Animation, AnimationTransition
99
from kivy.uix.widget import Widget
10-
from functools import partial
1110
from kivy.clock import Clock
1211
from kivy.graphics import Scale
1312

@@ -61,3 +60,27 @@ def test_animated_instruction(self):
6160
self.assertAlmostEqual(instruction.x, 3)
6261
self.sleep(1.5)
6362
self.assertAlmostEqual(instruction.x, 100)
63+
64+
65+
class SequentialAnimationTestCase(unittest.TestCase):
66+
67+
def sleep(self, t):
68+
start = time()
69+
while time() < start + t:
70+
sleep(.01)
71+
Clock.tick()
72+
73+
def setUp(self):
74+
self.a = Animation(x=100, d=1, t='out_bounce')
75+
self.a += Animation(x=0, d=1, t='out_bounce')
76+
self.w = Widget()
77+
78+
def test_stop_all(self):
79+
self.a.start(self.w)
80+
self.sleep(.5)
81+
Animation.stop_all(self.w)
82+
83+
def test_stop_all_2(self):
84+
self.a.start(self.w)
85+
self.sleep(.5)
86+
Animation.stop_all(self.w, 'x')

0 commit comments

Comments
 (0)