End of EoLA

This commit is contained in:
Grant Sanderson
2016-09-24 22:46:17 -07:00
parent 84967fd463
commit 73ff0af63d
2 changed files with 162 additions and 105 deletions

View File

@ -253,14 +253,18 @@ class Mobject(object):
self.to_edge(vect, **kwargs)
return self
def stretch_in_place(self, factor, dim):
self.do_in_place(self.stretch, factor, dim)
return self
def stretch_to_fit(self, length, dim, stretch = True):
old_length = self.length_over_dim(dim)
if old_length == 0:
return self
if stretch:
self.do_in_place(self.stretch, length/old_length, dim)
self.stretch_in_place(length/old_length, dim)
else:
self.do_in_place(self.scale, length/old_length)
self.scale_in_place(length/old_length)
return self
def stretch_to_fit_width(self, width):
@ -497,9 +501,6 @@ class Mobject(object):
def __iter__(self):
return iter(self.split())
def __len__(self):
return len(self.split())
def split(self):
result = [self] if len(self.points) > 0 else []
return result + self.submobjects