mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Change type hint on LaggedStart to accept any functions outputting animations
This commit is contained in:
parent
7d1330fa68
commit
4e90a77fcd
1 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,7 @@ class LaggedStart(AnimationGroup):
|
||||||
class LaggedStartMap(LaggedStart):
|
class LaggedStartMap(LaggedStart):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
AnimationClass: type,
|
anim_func: Callable[[Mobject], Animation],
|
||||||
group: Mobject,
|
group: Mobject,
|
||||||
arg_creator: Callable[[Mobject], tuple] | None = None,
|
arg_creator: Callable[[Mobject], tuple] | None = None,
|
||||||
run_time: float = 2.0,
|
run_time: float = 2.0,
|
||||||
|
@ -175,7 +175,7 @@ class LaggedStartMap(LaggedStart):
|
||||||
anim_kwargs = dict(kwargs)
|
anim_kwargs = dict(kwargs)
|
||||||
anim_kwargs.pop("lag_ratio", None)
|
anim_kwargs.pop("lag_ratio", None)
|
||||||
super().__init__(
|
super().__init__(
|
||||||
*(AnimationClass(submob, **anim_kwargs) for submob in group),
|
*(anim_func(submob, **anim_kwargs) for submob in group),
|
||||||
run_time=run_time,
|
run_time=run_time,
|
||||||
lag_ratio=lag_ratio,
|
lag_ratio=lag_ratio,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue