mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 11:03:03 +08:00
Update mobject.py
This commit is contained in:

committed by
GitHub

parent
6d0c55d2ba
commit
487f582302
@ -1596,6 +1596,15 @@ class Group(Mobject):
|
||||
raise Exception("All submobjects must be of type 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)
|
||||
|
||||
|
||||
class Point(Mobject):
|
||||
|
Reference in New Issue
Block a user