Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

GrowFromCenter transforms the mobject itself

Grant Sandersonfddea18da5cd
diff --git a/animation/transform.py b/animation/transform.py
index 905f86f35..c3724bc17 100644
--- a/animation/transform.py
+++ b/animation/transform.py
@@ -83,12 +83,11 @@ class CounterclockwiseTransform(Transform):
class GrowFromCenter(Transform):
def __init__(self, mobject, **kwargs):
- Transform.__init__(
- self,
- Point(mobject.get_center()),
- mobject,
- **kwargs
- )
+ target = mobject.copy()
+ point = Point(mobject.get_center())
+ mobject.replace(point)
+ mobject.highlight(point.get_color())
+ Transform.__init__(self, mobject, target, **kwargs)
class SpinInFromNothing(GrowFromCenter):
DEFAULT_CONFIG = {