mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
A nice small commit capturing one atomic change, as usual
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user