mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 05:52:34 +08:00
Changed all files to (mostly) conform to PEP8
This commit is contained in:
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user