Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

added getter and setter for VectorizedPoint's location

Ben Hambrecht8e0c84946f78
diff --git a/mobject/vectorized_mobject.py b/mobject/vectorized_mobject.py
index 7c840f8e1..5377eb44c 100644
--- a/mobject/vectorized_mobject.py
+++ b/mobject/vectorized_mobject.py
@@ -457,6 +457,12 @@ class VectorizedPoint(VMobject):
def get_height(self):
return self.artificial_height
+ def get_location(self):
+ return self.get_anchors()[0]
+
+ def set_location(self,new_loc):
+ self.set_points(np.array([new_loc]))
+
class BackgroundColoredVMobject(VMobject):
CONFIG = {
# Can be set to None, using set_background_array to initialize instead