Make LaggedStart adopt default rate_func and run_time of the animation it takes in

This commit is contained in:
Grant Sanderson 2019-01-29 23:51:24 -08:00
parent a409fd6fe5
commit 358b1e6313

View file

@ -220,10 +220,14 @@ class LaggedStart(Animation):
} }
def __init__(self, AnimationClass, mobject, arg_creator=None, **kwargs): def __init__(self, AnimationClass, mobject, arg_creator=None, **kwargs):
for key in ["rate_func", "run_time"]:
if key in AnimationClass.CONFIG:
setattr(self, key, AnimationClass.CONFIG[key])
digest_config(self, kwargs) digest_config(self, kwargs)
for key in "rate_func", "run_time", "lag_ratio": for key in "rate_func", "run_time", "lag_ratio":
if key in kwargs: if key in kwargs:
kwargs.pop(key) kwargs.pop(key)
if arg_creator is None: if arg_creator is None:
def arg_creator(mobject): def arg_creator(mobject):
return (mobject,) return (mobject,)