mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Add default Mobject.match_style
This commit is contained in:
parent
fa1080d59a
commit
f01b990c2e
1 changed files with 6 additions and 0 deletions
|
@ -1598,6 +1598,12 @@ class Mobject(object):
|
||||||
def match_color(self, mobject: Mobject) -> Self:
|
def match_color(self, mobject: Mobject) -> Self:
|
||||||
return self.set_color(mobject.get_color())
|
return self.set_color(mobject.get_color())
|
||||||
|
|
||||||
|
def match_style(self, mobject: Mobject) -> Self:
|
||||||
|
self.set_color(mobject.get_color())
|
||||||
|
self.set_opacity(mobject.get_opacity())
|
||||||
|
self.set_shading(*mobject.get_shading())
|
||||||
|
return self
|
||||||
|
|
||||||
def match_dim_size(self, mobject: Mobject, dim: int, **kwargs) -> Self:
|
def match_dim_size(self, mobject: Mobject, dim: int, **kwargs) -> Self:
|
||||||
return self.rescale_to_fit(
|
return self.rescale_to_fit(
|
||||||
mobject.length_over_dim(dim), dim,
|
mobject.length_over_dim(dim), dim,
|
||||||
|
|
Loading…
Add table
Reference in a new issue