Skip to content

Commit 7d3d477

Browse files
committed
Added missing check to return earlier if points are exactly the same in VMobject._update_curve_memory
1 parent e88cd64 commit 7d3d477

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

manim/mobject/types/vectorized_mobject.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,13 +1353,12 @@ def _update_curve_memory(self, sample_points: int = 10):
13531353
self._init_curve_memory(sample_points)
13541354
return
13551355

1356+
nppcc = self.n_points_per_cubic_curve
13561357
curr_points = self.points
13571358
memo_points = self.memory["piece_curves"]["points"]
1358-
13591359
curr_n_points = len(self.points)
13601360
memo_n_points = memo_points.shape[0]
13611361

1362-
nppcc = self.n_points_per_cubic_curve
13631362
n_points = min(curr_n_points, memo_n_points)
13641363
n_curves = n_points // nppcc
13651364
n_points = n_points * nppcc
@@ -1378,6 +1377,9 @@ def _update_curve_memory(self, sample_points: int = 10):
13781377
differences |= neq2[:, i]
13791378
differences = np.arange(n_curves)[differences]
13801379

1380+
if curr_n_points == memo_n_points and differences.shape[0] == 0:
1381+
return
1382+
13811383
# If the amount of points has changed, adjust lengths
13821384
curr_n_curves = curr_n_points // nppcc
13831385
memo_n_curves = memo_n_points // nppcc

0 commit comments

Comments
 (0)