mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
Update vectorized_mobject.py
This commit is contained in:

committed by
GitHub

parent
030fb52018
commit
c94ebaa260
@ -993,6 +993,16 @@ class VGroup(VMobject):
|
|||||||
raise Exception("All submobjects must be of type VMobject")
|
raise Exception("All submobjects must be of type VMobject")
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.add(*vmobjects)
|
self.add(*vmobjects)
|
||||||
|
|
||||||
|
def __add__(self:'VGroup', other : 'VMobject' or 'VGroup'):
|
||||||
|
assert(isinstance(other, VMobject))
|
||||||
|
if isinstance(other, VGroup):
|
||||||
|
return VGroup(*self, *other)
|
||||||
|
if isinstance(other, Mobject):
|
||||||
|
return Group(*self) + other
|
||||||
|
if other in self:
|
||||||
|
return self.add(other.copy())
|
||||||
|
return self.add(other)
|
||||||
|
|
||||||
|
|
||||||
class VectorizedPoint(Point, VMobject):
|
class VectorizedPoint(Point, VMobject):
|
||||||
|
Reference in New Issue
Block a user