mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Use resize_preserving_order in aligning VMobjects
This commit is contained in:
parent
2ca8848007
commit
eba86be35b
1 changed files with 6 additions and 2 deletions
|
@ -29,6 +29,7 @@ from manimlib.utils.iterables import listify
|
|||
from manimlib.utils.iterables import make_even
|
||||
from manimlib.utils.iterables import resize_array
|
||||
from manimlib.utils.iterables import resize_with_interpolation
|
||||
from manimlib.utils.iterables import resize_preserving_order
|
||||
from manimlib.utils.iterables import arrays_match
|
||||
from manimlib.utils.space_ops import angle_between_vectors
|
||||
from manimlib.utils.space_ops import cross2d
|
||||
|
@ -880,8 +881,11 @@ class VMobject(Mobject):
|
|||
new_subpaths2.append(new_subpaths2[0][-1])
|
||||
new_subpaths1.append(sp1)
|
||||
new_subpaths2.append(sp2)
|
||||
self.set_points(np.vstack(new_subpaths1))
|
||||
vmobject.set_points(np.vstack(new_subpaths2))
|
||||
|
||||
for mob, paths in [(self, new_subpaths1), (vmobject, new_subpaths2)]:
|
||||
new_points = np.vstack(paths)
|
||||
mob.resize_points(len(new_points), resize_func=resize_preserving_order)
|
||||
mob.set_points(new_points)
|
||||
return self
|
||||
|
||||
def insert_n_curves(self, n: int, recurse: bool = True):
|
||||
|
|
Loading…
Add table
Reference in a new issue