Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ def move_to(
self.shift((target - point_to_align) * coor_mask)
return self

def replace(
def match_size_and_position_to(
self, mobject: Mobject, dim_to_match: int = 0, stretch: bool = False
) -> Self:
if not mobject.get_num_points() and not mobject.submobjects:
Expand All @@ -1928,6 +1928,19 @@ def replace(
self.shift(mobject.get_center() - self.get_center())
return self

def replace(
self, mobject: Mobject, dim_to_match: int = 0, stretch: bool = False
) -> Self:
"""Deprecated: use match_size_and_position_to() instead."""
import warnings

warnings.warn(
"replace() is deprecated, use match_size_and_position_to() instead.",
DeprecationWarning,
stacklevel=2,
)
return self.match_size_and_position_to(mobject, dim_to_match, stretch)

def surround(
self,
mobject: Mobject,
Expand Down
15 changes: 14 additions & 1 deletion manim/mobject/opengl/opengl_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ def move_to(
self.shift((target - point_to_align) * coor_mask)
return self

def replace(
def match_size_and_position_to(
self,
mobject: OpenGLMobject,
dim_to_match: int = 0,
Expand All @@ -2121,6 +2121,19 @@ def replace(
self.shift(mobject.get_center() - self.get_center())
return self

def replace(
self, mobject: OpenGLMobject, dim_to_match: int = 0, stretch: bool = False
) -> Self:
"""Deprecated: use match_size_and_position_to() instead."""
import warnings

warnings.warn(
"replace() is deprecated, use match_size_and_position_to() instead.",
DeprecationWarning,
stacklevel=2,
)
return self.match_size_and_position_to(mobject, dim_to_match, stretch)

def surround(
self,
mobject: OpenGLMobject,
Expand Down
Loading