mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Kill config in growing.py
This commit is contained in:
parent
5571c7d576
commit
7474a98752
1 changed files with 10 additions and 12 deletions
|
@ -10,15 +10,19 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
from manimlib.mobject.geometry import Arrow
|
from manimlib.mobject.geometry import Arrow
|
||||||
from manimlib.mobject.mobject import Mobject
|
from manimlib.mobject.mobject import Mobject
|
||||||
|
from manimlib.constants import ManimColor
|
||||||
|
|
||||||
|
|
||||||
class GrowFromPoint(Transform):
|
class GrowFromPoint(Transform):
|
||||||
CONFIG = {
|
def __init__(
|
||||||
"point_color": None,
|
self,
|
||||||
}
|
mobject: Mobject,
|
||||||
|
point: np.ndarray,
|
||||||
def __init__(self, mobject: Mobject, point: np.ndarray, **kwargs):
|
point_color: ManimColor = None,
|
||||||
|
**kwargs
|
||||||
|
):
|
||||||
self.point = point
|
self.point = point
|
||||||
|
self.point_color = point_color
|
||||||
super().__init__(mobject, **kwargs)
|
super().__init__(mobject, **kwargs)
|
||||||
|
|
||||||
def create_target(self) -> Mobject:
|
def create_target(self) -> Mobject:
|
||||||
|
@ -28,7 +32,7 @@ class GrowFromPoint(Transform):
|
||||||
start = super().create_starting_mobject()
|
start = super().create_starting_mobject()
|
||||||
start.scale(0)
|
start.scale(0)
|
||||||
start.move_to(self.point)
|
start.move_to(self.point)
|
||||||
if self.point_color:
|
if self.point_color is not None:
|
||||||
start.set_color(self.point_color)
|
start.set_color(self.point_color)
|
||||||
return start
|
return start
|
||||||
|
|
||||||
|
@ -49,9 +53,3 @@ class GrowArrow(GrowFromPoint):
|
||||||
def __init__(self, arrow: Arrow, **kwargs):
|
def __init__(self, arrow: Arrow, **kwargs):
|
||||||
point = arrow.get_start()
|
point = arrow.get_start()
|
||||||
super().__init__(arrow, point, **kwargs)
|
super().__init__(arrow, point, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class SpinInFromNothing(GrowFromCenter):
|
|
||||||
CONFIG = {
|
|
||||||
"path_arc": PI,
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue