Changed all files to (mostly) conform to PEP8

This commit is contained in:
Grant Sanderson
2018-04-06 13:58:59 -07:00
parent 7c272c6236
commit d4392de600
71 changed files with 3736 additions and 3604 deletions

View File

@ -12,6 +12,7 @@ class UpdateFromFunc(Animation):
to be used when the state of one mobject is dependent
on another simultaneously animated mobject
"""
def __init__(self, mobject, update_function, **kwargs):
digest_config(self, kwargs, locals())
Animation.__init__(self, mobject, **kwargs)
@ -19,29 +20,27 @@ class UpdateFromFunc(Animation):
def update_mobject(self, alpha):
self.update_function(self.mobject)
class UpdateFromAlphaFunc(UpdateFromFunc):
def update_mobject(self, alpha):
self.update_function(self.mobject, alpha)
class MaintainPositionRelativeTo(Animation):
CONFIG = {
"tracked_critical_point" : ORIGIN
"tracked_critical_point": ORIGIN
}
def __init__(self, mobject, tracked_mobject, **kwargs):
digest_config(self, kwargs, locals())
tcp = self.tracked_critical_point
self.diff = mobject.get_critical_point(tcp) - \
tracked_mobject.get_critical_point(tcp)
tracked_mobject.get_critical_point(tcp)
Animation.__init__(self, mobject, **kwargs)
def update_mobject(self, alpha):
self.mobject.shift(
self.tracked_mobject.get_critical_point(self.tracked_critical_point) - \
self.mobject.get_critical_point(self.tracked_critical_point) + \
self.tracked_mobject.get_critical_point(self.tracked_critical_point) -
self.mobject.get_critical_point(self.tracked_critical_point) +
self.diff
)