mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
A few bug fixes to the very buggy SVGMobject
This commit is contained in:
@ -560,6 +560,15 @@ class Mobject(object):
|
||||
self.center()
|
||||
return self
|
||||
|
||||
def sort_submobjects(self, point_to_num_func = lambda p : p[0]):
|
||||
self.submobjects.sort(
|
||||
lambda *mobs : cmp(*[
|
||||
point_to_num_func(mob.get_center())
|
||||
for mob in mobs
|
||||
])
|
||||
)
|
||||
return self
|
||||
|
||||
## Alignment
|
||||
def align_data(self, mobject):
|
||||
self.align_submobjects(mobject)
|
||||
|
Reference in New Issue
Block a user