(
self, mobject: Mobject, dim_to_match: int = 0, stretch: bool = False
)
| 1893 | return self |
| 1894 | |
| 1895 | def replace( |
| 1896 | self, mobject: Mobject, dim_to_match: int = 0, stretch: bool = False |
| 1897 | ) -> Self: |
| 1898 | if not mobject.get_num_points() and not mobject.submobjects: |
| 1899 | raise Warning("Attempting to replace mobject with no points") |
| 1900 | if stretch: |
| 1901 | self.stretch_to_fit_width(mobject.width) |
| 1902 | self.stretch_to_fit_height(mobject.height) |
| 1903 | else: |
| 1904 | self.rescale_to_fit( |
| 1905 | mobject.length_over_dim(dim_to_match), |
| 1906 | dim_to_match, |
| 1907 | stretch=False, |
| 1908 | ) |
| 1909 | self.shift(mobject.get_center() - self.get_center()) |
| 1910 | return self |
| 1911 | |
| 1912 | def surround( |
| 1913 | self, |
no test coverage detected