A few bug fixes to the very buggy SVGMobject

This commit is contained in:
Grant Sanderson
2017-02-08 13:29:32 -08:00
parent fd5dc23839
commit ac137eb683
5 changed files with 480 additions and 42 deletions

View File

@ -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)