mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
Change so that lambda is not given a name
This commit is contained in:
@ -19,7 +19,6 @@ from manimlib.utils.paths import straight_path
|
|||||||
from manimlib.utils.simple_functions import get_parameters
|
from manimlib.utils.simple_functions import get_parameters
|
||||||
from manimlib.utils.space_ops import angle_of_vector
|
from manimlib.utils.space_ops import angle_of_vector
|
||||||
from manimlib.utils.space_ops import get_norm
|
from manimlib.utils.space_ops import get_norm
|
||||||
from manimlib.utils.space_ops import normalize
|
|
||||||
from manimlib.utils.space_ops import rotation_matrix_transpose
|
from manimlib.utils.space_ops import rotation_matrix_transpose
|
||||||
from manimlib.shader_wrapper import ShaderWrapper
|
from manimlib.shader_wrapper import ShaderWrapper
|
||||||
|
|
||||||
@ -1036,9 +1035,10 @@ class Mobject(object):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def sort(self, point_to_num_func=lambda p: p[0], submob_func=None):
|
def sort(self, point_to_num_func=lambda p: p[0], submob_func=None):
|
||||||
if submob_func is None:
|
if submob_func is not None:
|
||||||
submob_func = lambda m: point_to_num_func(m.get_center())
|
self.submobjects.sort(key=submob_func)
|
||||||
self.submobjects.sort(key=submob_func)
|
else:
|
||||||
|
self.submobjects.sort(key=lambda m: point_to_num_func(m.get_center()))
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def shuffle(self, recursive=False):
|
def shuffle(self, recursive=False):
|
||||||
|
Reference in New Issue
Block a user