mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 05:52:34 +08:00
Bug fix to ApplyMethod treatment of method kwargs
This commit is contained in:
@ -146,7 +146,7 @@ class ApplyMethod(Transform):
|
||||
args = list(args) #So that args.pop() works
|
||||
if "method_kwargs" in kwargs:
|
||||
method_kwargs = kwargs["method_kwargs"]
|
||||
elif isinstance(args[-1], dict):
|
||||
elif len(args) > 0 and isinstance(args[-1], dict):
|
||||
method_kwargs = args.pop()
|
||||
else:
|
||||
method_kwargs = {}
|
||||
|
@ -180,7 +180,7 @@ class Mobject(object):
|
||||
kwargs["about_point"] = ORIGIN
|
||||
self.apply_points_function_about_point(
|
||||
lambda points : np.apply_along_axis(function, 1, points),
|
||||
about_point = about_point, **kwargs
|
||||
**kwargs
|
||||
)
|
||||
return self
|
||||
|
||||
|
@ -366,7 +366,7 @@ class Scene(object):
|
||||
else:
|
||||
mobject.target = mobject.copy()
|
||||
#
|
||||
if isinstance(state["method_args"][-1], dict):
|
||||
if len(state["method_args"]) > 0 and isinstance(state["method_args"][-1], dict):
|
||||
method_kwargs = state["method_args"].pop()
|
||||
else:
|
||||
method_kwargs = {}
|
||||
|
Reference in New Issue
Block a user