A nice small commit capturing one atomic change, as usual

This commit is contained in:
Grant Sanderson
2016-08-25 17:15:48 -07:00
parent 15731dc9a2
commit 25efbbf0b0
9 changed files with 499 additions and 62 deletions

View File

@ -313,28 +313,16 @@ class BackgroundRectangle(Rectangle):
"fill_opacity" : 0.75,
}
def __init__(self, mobject, **kwargs):
self.lock_style = False
Rectangle.__init__(self, **kwargs)
self.lock_style = True
self.replace(mobject, stretch = True)
self.original_fill_opacity = self.fill_opacity
def pointwise_become_partial(self, mobject, a, b):
self.lock_style = False
self.set_fill(opacity = b*self.original_fill_opacity)
self.lock_style = True
return self
def fade_to(self, *args, **kwargs):
self.lock_style = False
Rectangle.fade_to(self, *args, **kwargs)
self.lock_style = True
return self
def set_style_data(self, *args, **kwargs):
if self.lock_style:
return self #Do nothing
return Rectangle.set_style_data(self, *args, **kwargs)
def get_fill_color(self):
return Color(self.color)
class Grid(VMobject):