Kill config in update.py

This commit is contained in:
Grant Sanderson
2022-12-14 16:02:15 -08:00
parent 4aa7d439f1
commit ca1ba67a85

View File

@ -16,24 +16,35 @@ class UpdateFromFunc(Animation):
to be used when the state of one mobject is dependent
on another simultaneously animated mobject
"""
CONFIG = {
"suspend_mobject_updating": False,
}
def __init__(
self,
mobject: Mobject,
update_function: Callable[[Mobject]],
update_function: Callable[[Mobject], Mobject | None],
suspend_mobject_updating: bool = False,
**kwargs
):
self.update_function = update_function
super().__init__(mobject, **kwargs)
super().__init__(
mobject,
suspend_mobject_updating=suspend_mobject_updating,
**kwargs
)
def interpolate_mobject(self, alpha: float) -> None:
self.update_function(self.mobject)
class UpdateFromAlphaFunc(UpdateFromFunc):
class UpdateFromAlphaFunc(Animation):
def __init__(
self,
mobject: Mobject,
update_function: Callable[[Mobject, float], Mobject | None],
suspend_mobject_updating: bool = False,
**kwargs
):
self.update_function = update_function
super().__init__(mobject, suspend_mobject_updating=suspend_mobject_updating, **kwargs)
def interpolate_mobject(self, alpha: float) -> None:
self.update_function(self.mobject, alpha)