Add family option to match_style

This commit is contained in:
Grant Sanderson 2018-08-20 15:51:12 -07:00
parent 4a71577bcc
commit da792ef2d9

View file

@ -158,12 +158,13 @@ class VMobject(Mobject):
self.set_stroke(color, family=family)
return self
def match_style(self, vmobject):
def match_style(self, vmobject, family=True):
for a_name in ["fill_rgbas", "stroke_rgbas", "background_stroke_rgbas"]:
setattr(self, a_name, np.array(getattr(vmobject, a_name)))
self.stroke_width = vmobject.stroke_width
self.background_stroke_width = vmobject.background_stroke_width
if family:
# Does its best to match up submobject lists, and
# match styles accordingly
submobs1, submobs2 = self.submobjects, vmobject.submobjects