80% through cube example

This commit is contained in:
Grant Sanderson
2017-01-26 19:59:55 -08:00
parent 25e99ea1bc
commit b4e93b3376
5 changed files with 693 additions and 25 deletions

View File

@ -100,11 +100,16 @@ class DrawBorderThenFill(Animation):
Animation.__init__(self, vmobject, **kwargs)
def update_submobject(self, submobject, starting_submobject, alpha):
submobject.pointwise_become_partial(
starting_submobject, 0, min(2*alpha, 1)
)
if alpha < 0.5:
submobject.pointwise_become_partial(
starting_submobject, 0, 2*alpha
)
color = self.stroke_color or starting_submobject.get_color()
if self.stroke_color:
color = self.stroke_color
elif starting_submobject.stroke_width > 0:
color = starting_submobject.get_stroke_color()
else:
color = starting_submobject.get_color()
submobject.set_stroke(color, width = self.stroke_width)
submobject.set_fill(opacity = 0)
else: