File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -825,8 +825,9 @@ class LabeledDot(Dot):
825825 representing rendered strings like :class:`~.Text` or :class:`~.Tex`
826826 can be passed as well.
827827 radius
828- The radius of the :class:`Dot`. If ``None`` (the default), the radius
829- is calculated based on the size of the ``label``.
828+ The radius of the :class:`Dot`. If provided, the ``buff`` is ignored.
829+ If ``None`` (the default), the radius is calculated based on the size
830+ of the ``label`` and the ``buff``.
830831
831832 Examples
832833 --------
@@ -852,6 +853,7 @@ def __init__(
852853 self ,
853854 label : str | SingleStringMathTex | Text | Tex ,
854855 radius : float | None = None ,
856+ buff : float = SMALL_BUFF ,
855857 ** kwargs : Any ,
856858 ) -> None :
857859 if isinstance (label , str ):
@@ -862,7 +864,9 @@ def __init__(
862864 rendered_label = label
863865
864866 if radius is None :
865- radius = 0.1 + max (rendered_label .width , rendered_label .height ) / 2
867+ radius = buff + float (
868+ np .linalg .norm ([rendered_label .width , rendered_label .height ]) / 2
869+ )
866870 super ().__init__ (radius = radius , ** kwargs )
867871 rendered_label .move_to (self .get_center ())
868872 self .add (rendered_label )
You can’t perform that action at this time.
0 commit comments