Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added Line.set_length

Grant Sanderson8ce13875a30d
diff --git a/manimlib/mobject/geometry.py b/manimlib/mobject/geometry.py
index a846cc558..2d37a4748 100644
--- a/manimlib/mobject/geometry.py
+++ b/manimlib/mobject/geometry.py
@@ -514,6 +514,9 @@ class Line(TipableVMobject):
about_point=self.get_start(),
)
+ def set_length(self, length):
+ self.scale(length / self.get_length())
+
def set_opacity(self, opacity, family=True):
# Overwrite default, which would set
# the fill opacity