Skip to content

Commit 7356a36

Browse files
committed
Only call self.throw_error_if_no_points once for get_start_and_end
1 parent f3e3a7c commit 7356a36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

manimlib/mobject/mobject.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,14 +1088,16 @@ def get_z(self, direction=ORIGIN):
10881088

10891089
def get_start(self):
10901090
self.throw_error_if_no_points()
1091-
return np.array(self.get_points()[0])
1091+
return self.get_points()[0].copy()
10921092

10931093
def get_end(self):
10941094
self.throw_error_if_no_points()
1095-
return np.array(self.get_points()[-1])
1095+
return self.get_points()[-1].copy()
10961096

10971097
def get_start_and_end(self):
1098-
return self.get_start(), self.get_end()
1098+
self.throw_error_if_no_points()
1099+
points = self.get_points()
1100+
return (points[0].copy(), points[-1].copy())
10991101

11001102
def point_from_proportion(self, alpha):
11011103
points = self.get_points()

0 commit comments

Comments
 (0)