Update mobject.py

This commit is contained in:
Bill Xi 2021-10-31 18:35:28 +08:00 committed by GitHub
parent 4eabaecfc8
commit f9a6fa7036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1594,14 +1594,7 @@ class Group(Mobject):
Mobject.__init__(self, **kwargs)
self.add(*mobjects)
def __add__(self, other : 'Mobject' or 'Group'):
assert(isinstance(other, Mobject))
if other in self:
return Group(*self, other.copy())
if isinstance(other, (Group, VGroup)):
if all([isinstance(i, VMobject) for i in Group(*self, *other)]):
return VGroup(*self, *other)
return Group(*self, *other)
return Group(*self, other)
return self.add(other)
class Point(Mobject):