Have AnimationGroup initialize its runtime before begin is called. This way it can be composed

This commit is contained in:
Grant Sanderson 2019-09-30 12:06:17 -07:00
parent 4eb6c6fb5b
commit c94aef8845

View file

@ -33,6 +33,7 @@ class AnimationGroup(Animation):
self.group = Group(*remove_list_redundancies( self.group = Group(*remove_list_redundancies(
[anim.mobject for anim in animations] [anim.mobject for anim in animations]
)) ))
self.init_run_time()
Animation.__init__(self, self.group, **kwargs) Animation.__init__(self, self.group, **kwargs)
def get_all_mobjects(self): def get_all_mobjects(self):
@ -41,7 +42,7 @@ class AnimationGroup(Animation):
def begin(self): def begin(self):
for anim in self.animations: for anim in self.animations:
anim.begin() anim.begin()
self.init_run_time() # self.init_run_time()
def finish(self): def finish(self):
for anim in self.animations: for anim in self.animations: