mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 17:29:06 +08:00
Improved VMobject.match_style method to handle submobjects in a smarter way
This commit is contained in:
@ -92,9 +92,15 @@ class VMobject(Mobject):
|
||||
fill_opacity = vmobject.get_fill_opacity(),
|
||||
family = False
|
||||
)
|
||||
#TODO: This behaviro may not be optimal when submobject
|
||||
#lists dont' have the same length
|
||||
for sm1, sm2 in zip(self.submobjects, vmobject.submobjects):
|
||||
|
||||
#Does its best to match up submobject lists, and
|
||||
#match styles accordingly
|
||||
submobs1, submobs2 = self.submobjects, vmobject.submobjects
|
||||
if len(submobs1) == 0:
|
||||
return
|
||||
elif len(submobs2) == 0:
|
||||
submobs2 = [vmobject]
|
||||
for sm1, sm2 in zip(*make_even(submobs1, submobs2)):
|
||||
sm1.match_style(sm2)
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user