diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index 8557490ed9..5fe08eafc3 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -1776,10 +1776,7 @@ def put_start_and_end_on(self, start: Point3DLike, end: Point3DLike) -> Self: curr_start, curr_end = self.get_start_and_end() curr_vect = curr_end - curr_start if np.all(curr_vect == 0): - # TODO: this looks broken. It makes self.points a Point3D instead - # of a Point3D_Array. However, modifying this breaks some tests - # where this is currently expected. - self.points = np.array(start) + self.points = np.array([start]) return self target_vect = np.asarray(end) - np.asarray(start) axis = ( diff --git a/tests/module/mobject/graphing/test_number_line.py b/tests/module/mobject/graphing/test_number_line.py index 1f0f7c343c..786d37aaff 100644 --- a/tests/module/mobject/graphing/test_number_line.py +++ b/tests/module/mobject/graphing/test_number_line.py @@ -2,7 +2,7 @@ import numpy as np -from manim import DashedLine, NumberLine +from manim import Line, NumberLine from manim.mobject.text.numbers import Integer @@ -126,7 +126,8 @@ def test_point_to_number(): def test_start_and_end_at_same_point(): - line = DashedLine(np.zeros(3), np.zeros(3)) - line.put_start_and_end_on(np.zeros(3), np.array([0, 0, 0])) + point = [1.0, 2.0, 3.0] + line = Line(point, point) + line.put_start_and_end_on(point, point) - np.testing.assert_array_equal(np.round(np.zeros(3), 4), np.round(line.points, 4)) + np.testing.assert_array_equal(np.round([point], 4), np.round(line.points, 4))