Commit 426fbee 1 parent 45093f3 commit 426fbee Copy full SHA for 426fbee
File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -353,7 +353,6 @@ def duration(self):
353
353
354
354
def start (self , widget ):
355
355
self .stop (widget )
356
- self ._widgets [widget .uid ] = True
357
356
self ._register ()
358
357
self .anim1 .start (widget )
359
358
Original file line number Diff line number Diff line change 7
7
from time import time , sleep
8
8
from kivy .animation import Animation , AnimationTransition
9
9
from kivy .uix .widget import Widget
10
- from functools import partial
11
10
from kivy .clock import Clock
12
11
from kivy .graphics import Scale
13
12
@@ -61,3 +60,27 @@ def test_animated_instruction(self):
61
60
self .assertAlmostEqual (instruction .x , 3 )
62
61
self .sleep (1.5 )
63
62
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' )
You can’t perform that action at this time.
0 commit comments