Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3103,21 +3103,22 @@ def construct(self):
--------
:meth:`~.Mobject.align_data`, :meth:`~.VMobject.interpolate_color`
"""
mobject = mobject.copy()
if stretch:
mobject.stretch_to_fit_height(self.height)
mobject.stretch_to_fit_width(self.width)
mobject.stretch_to_fit_depth(self.depth)
else:
if match_height:
mobject.match_height(self)
if match_width:
mobject.match_width(self)
if match_depth:
mobject.match_depth(self)

if match_center:
mobject.move_to(self.get_center())
if stretch or match_height or match_width or match_depth or match_center:
mobject = mobject.copy()
if stretch:
mobject.stretch_to_fit_height(self.height)
mobject.stretch_to_fit_width(self.width)
mobject.stretch_to_fit_depth(self.depth)
else:
if match_height:
mobject.match_height(self)
if match_width:
mobject.match_width(self)
if match_depth:
mobject.match_depth(self)

if match_center:
mobject.move_to(self.get_center())

self.align_data(mobject, skip_point_alignment=True)
for sm1, sm2 in zip(self.get_family(), mobject.get_family()):
Expand Down
Loading