mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
cc1142eeb2
commit
929d321db3
1 changed files with 35 additions and 34 deletions
|
|
@ -2557,42 +2557,43 @@ class Mobject:
|
|||
return [m for m in self.get_family() if m.get_num_points() > 0]
|
||||
|
||||
def arrange(
|
||||
self,
|
||||
direction: Vector3DLike = RIGHT,
|
||||
buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
|
||||
center: bool = True,
|
||||
reference: Mobject | None = None,
|
||||
**kwargs: Any,
|
||||
) -> Self:
|
||||
"""Sorts :class:`~.Mobject` next to each other on screen.
|
||||
self,
|
||||
direction: Vector3DLike = RIGHT,
|
||||
buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
|
||||
center: bool = True,
|
||||
reference: Mobject | None = None,
|
||||
**kwargs: Any,
|
||||
) -> Self:
|
||||
"""Sorts :class:`~.Mobject` next to each other on screen.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
direction
|
||||
The direction in which the submobjects should be arranged.
|
||||
buff
|
||||
The distance between neighboring submobjects.
|
||||
center
|
||||
Whether to center the mobject after arranging.
|
||||
reference
|
||||
The submobject to use as the reference for the arrangement. If not
|
||||
set, the first submobject is used.
|
||||
---------
|
||||
direction
|
||||
The direction in which the submobjects should be arranged.
|
||||
buff
|
||||
The distance between neighboring submobjects.
|
||||
center
|
||||
Whether to center the mobject after arranging.
|
||||
reference
|
||||
The submobject to use as the reference for the arrangement. If not
|
||||
set, the first submobject is used.
|
||||
|
||||
Examples
|
||||
--------
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. manim:: Example
|
||||
:save_last_frame:
|
||||
.. manim:: Example
|
||||
:save_last_frame:
|
||||
|
||||
class Example(Scene):
|
||||
def construct(self):
|
||||
s1 = Square()
|
||||
s2 = Square()
|
||||
s3 = Square()
|
||||
s4 = Square()
|
||||
x = VGroup(s1, s2, s3, s4).set_x(0).arrange(buff=1.0)
|
||||
self.add(x)
|
||||
"""
|
||||
|
||||
class Example(Scene):
|
||||
def construct(self):
|
||||
s1 = Square()
|
||||
s2 = Square()
|
||||
s3 = Square()
|
||||
s4 = Square()
|
||||
x = VGroup(s1, s2, s3, s4).set_x(0).arrange(buff=1.0)
|
||||
self.add(x)
|
||||
"""
|
||||
submobjects = list(self.submobjects)
|
||||
|
||||
if reference is None:
|
||||
|
|
@ -2617,7 +2618,7 @@ class Mobject:
|
|||
if center:
|
||||
self.center()
|
||||
return self
|
||||
|
||||
|
||||
def arrange_in_grid(
|
||||
self,
|
||||
rows: int | None = None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue