Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions manim/mobject/geometry/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,9 @@ class LabeledDot(Dot):
representing rendered strings like :class:`~.Text` or :class:`~.Tex`
can be passed as well.
radius
The radius of the :class:`Dot`. If ``None`` (the default), the radius
is calculated based on the size of the ``label``.
The radius of the :class:`Dot`. If provided, the ``buff`` is ignored.
If ``None`` (the default), the radius is calculated based on the size
of the ``label`` and the ``buff``.

Examples
--------
Expand All @@ -784,6 +785,7 @@ def __init__(
self,
label: str | SingleStringMathTex | Text | Tex,
radius: float | None = None,
buff: float = SMALL_BUFF,
**kwargs: Any,
) -> None:
if isinstance(label, str):
Expand All @@ -794,7 +796,9 @@ def __init__(
rendered_label = label

if radius is None:
radius = 0.1 + max(rendered_label.width, rendered_label.height) / 2
radius = buff + float(
np.linalg.norm([rendered_label.width, rendered_label.height]) / 2
)
super().__init__(radius=radius, **kwargs)
rendered_label.move_to(self.get_center())
self.add(rendered_label)
Expand Down
Loading