Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Small bug-fix to DashedLine to ensure get_end works right

Grant Sandersonbb0595e3e77d
diff --git a/mobject/geometry.py b/mobject/geometry.py
index f9683221a..478c079d1 100644
--- a/mobject/geometry.py
+++ b/mobject/geometry.py
@@ -443,6 +443,9 @@ class DashedLine(Line):
self.add(Line(self.start, self.end))
return self
num_interp_points = int(length / self.dashed_segment_length)
+ # Even number ensures that start and end points are hit
+ if num_interp_points % 2 == 1:
+ num_interp_points += 1
points = [
interpolate(self.start, self.end, alpha)
for alpha in np.linspace(0, 1, num_interp_points)