File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ def _setup_scene(self, scene) -> None:
9898 anim ._setup_scene (scene )
9999
100100 def finish (self ) -> None :
101- self .interpolate (1 )
101+ for anim in self .animations :
102+ anim .finish ()
102103 self .anims_begun [:] = True
103104 self .anims_finished [:] = True
104105 if self .suspend_mobject_updating :
Original file line number Diff line number Diff line change @@ -171,6 +171,24 @@ def test_animationgroup_is_passing_remover_to_nested_animationgroups():
171171 assert polygon_animation .remover
172172
173173
174+ def test_animationgroup_calls_finish ():
175+ class MyAnimation (Animation ):
176+ def __init__ (self , mobject ):
177+ super ().__init__ (mobject )
178+ self .finished = False
179+
180+ def finish (self ):
181+ self .finished = True
182+
183+ scene = Scene ()
184+ sqr_animation = MyAnimation (Square ())
185+ circ_animation = MyAnimation (Circle ())
186+ animation_group = AnimationGroup (sqr_animation , circ_animation )
187+ scene .play (animation_group )
188+ assert sqr_animation .finished
189+ assert circ_animation .finished
190+
191+
174192def test_empty_animation_group_fails ():
175193 with pytest .raises (ValueError , match = "Please add at least one subanimation." ):
176194 AnimationGroup ().begin ()
You can’t perform that action at this time.
0 commit comments