Skip to content

Commit

Permalink
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER -> DEFAULT_MOBJECT_TO_MOBJECT_BUFF
Browse files Browse the repository at this point in the history
And likewise DEFAULT_MOBJECT_TO_MOBJECT_BUFFER -> DEFAULT_MOBJECT_TO_MOBJECT_BUFF
  • Loading branch information
3b1b committed Dec 11, 2024
1 parent c9b6ee5 commit d5c36de
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/source/documentation/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Buffs
MED_LARGE_BUFF = 0.5
LARGE_BUFF = 1
DEFAULT_MOBJECT_TO_EDGE_BUFFER = MED_LARGE_BUFF # Distance between object and edge
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER = MED_SMALL_BUFF # Distance between objects
DEFAULT_MOBJECT_TO_EDGE_BUFF = MED_LARGE_BUFF # Distance between object and edge
DEFAULT_MOBJECT_TO_MOBJECT_BUFF = MED_SMALL_BUFF # Distance between objects
Run times
---------
Expand Down
4 changes: 2 additions & 2 deletions manimlib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
MED_LARGE_BUFF: float = GLOBAL_CONFIG["sizes"]["med_large_buff"]
LARGE_BUFF: float = GLOBAL_CONFIG["sizes"]["large_buff"]

DEFAULT_MOBJECT_TO_EDGE_BUFFER: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_edge_buff"]
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_mobject_buff"]
DEFAULT_MOBJECT_TO_EDGE_BUFF: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_edge_buff"]
DEFAULT_MOBJECT_TO_MOBJECT_BUFF: float = GLOBAL_CONFIG["sizes"]["default_mobject_to_mobject_buff"]


# Standard vectors
Expand Down
14 changes: 7 additions & 7 deletions manimlib/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import numbers
import numpy as np

from manimlib.constants import DEFAULT_MOBJECT_TO_EDGE_BUFFER
from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFFER
from manimlib.constants import DEFAULT_MOBJECT_TO_EDGE_BUFF
from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFF
from manimlib.constants import DOWN, IN, LEFT, ORIGIN, OUT, RIGHT, UP
from manimlib.constants import FRAME_X_RADIUS, FRAME_Y_RADIUS
from manimlib.constants import MED_SMALL_BUFF
Expand Down Expand Up @@ -1055,7 +1055,7 @@ def center(self) -> Self:
def align_on_border(
self,
direction: Vect3,
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFFER
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFF
) -> Self:
"""
Direction just needs to be a vector pointing towards side or
Expand All @@ -1071,22 +1071,22 @@ def align_on_border(
def to_corner(
self,
corner: Vect3 = LEFT + DOWN,
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFFER
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFF
) -> Self:
return self.align_on_border(corner, buff)

def to_edge(
self,
edge: Vect3 = LEFT,
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFFER
buff: float = DEFAULT_MOBJECT_TO_EDGE_BUFF
) -> Self:
return self.align_on_border(edge, buff)

def next_to(
self,
mobject_or_point: Mobject | Vect3,
direction: Vect3 = RIGHT,
buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFF,
aligned_edge: Vect3 = ORIGIN,
submobject_to_align: Mobject | None = None,
index_of_submobject_to_align: int | slice | None = None,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ def shift_onto_screen(self, **kwargs) -> Self:
space_lengths = [FRAME_X_RADIUS, FRAME_Y_RADIUS]
for vect in UP, DOWN, LEFT, RIGHT:
dim = np.argmax(np.abs(vect))
buff = kwargs.get("buff", DEFAULT_MOBJECT_TO_EDGE_BUFFER)
buff = kwargs.get("buff", DEFAULT_MOBJECT_TO_EDGE_BUFF)
max_val = space_lengths[dim] - buff
edge_center = self.get_edge_center(vect)
if np.dot(edge_center, vect) > max_val:
Expand Down
6 changes: 3 additions & 3 deletions manimlib/mobject/svg/brace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np

from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFFER, SMALL_BUFF
from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFF, SMALL_BUFF
from manimlib.constants import DOWN, LEFT, ORIGIN, RIGHT, DL, DR, UL
from manimlib.constants import PI
from manimlib.animation.composition import AnimationGroup
Expand Down Expand Up @@ -79,7 +79,7 @@ def put_at_tip(
)
else:
mob.move_to(self.get_tip())
buff = kwargs.get("buff", DEFAULT_MOBJECT_TO_MOBJECT_BUFFER)
buff = kwargs.get("buff", DEFAULT_MOBJECT_TO_MOBJECT_BUFF)
shift_distance = mob.get_width() / 2.0 + buff
mob.shift(self.get_direction() * shift_distance)
return self
Expand Down Expand Up @@ -116,7 +116,7 @@ def __init__(
text: str | Iterable[str],
brace_direction: np.ndarray = DOWN,
label_scale: float = 1.0,
label_buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
label_buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFF,
**kwargs
) -> None:
super().__init__(**kwargs)
Expand Down

0 comments on commit d5c36de

Please sign in to comment.