Menu

#423 'bend left' bug if used with a formula

v1.0 (example)
closed-fixed
nobody
None
5
2018-12-23
2017-03-14
No

The following example shows the bug:

\documentclass[margin=1mm,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw [red,->] (0,0) to[bend left=-90*-1] (1,0);
\end{tikzpicture}
\end{document}

Here is a patch proposal:

\documentclass[margin=1mm,tikz]{standalone}

\makeatletter
\tikzoption{bend angle}{\pgfmahtsetmacro\tikz@to@bend{#1}}

\tikzoption{bend left}[]{%
  \def\pgf@temp{#1}%
  \ifx\pgf@temp\pgfutil@empty%
  \else%
    \pgfmathsetmacro\tikz@to@bend{#1}%
  \fi%
  \let\tikz@to@out=\tikz@to@bend%
  \c@pgf@counta=180\relax%
  \advance\c@pgf@counta by-\tikz@to@out\relax%
  \edef\tikz@to@in{\the\c@pgf@counta}%
  \tikz@to@switch@on%
  \tikz@to@relativetrue%
}

\tikzoption{bend right}[]{%
  \def\pgf@temp{#1}%
  \ifx\pgf@temp\pgfutil@empty%
  \else%
    \pgfmathsetmacro\tikz@to@bend{#1}%
  \fi%
  % Now, negate
  \pgfmathsetmacro\tikz@to@out{\tikz@to@bend}  
  \c@pgf@counta=\tikz@to@bend\relax%
  \c@pgf@counta=-\c@pgf@counta\relax%
  \edef\tikz@to@out{\the\c@pgf@counta}%
  \c@pgf@counta=180\relax%
  \advance\c@pgf@counta by-\tikz@to@out\relax%
  \edef\tikz@to@in{\the\c@pgf@counta}%
  \tikz@to@switch@on%
  \tikz@to@relativetrue%
}

\makeatother

\begin{document}
\begin{tikzpicture}
  \draw [red,->] (0,0) to[bend left=-90*-1] (1,0);
\end{tikzpicture}
\end{document}

Discussion

  • Stefan Pinnow

    Stefan Pinnow - 2018-12-23
    • status: open --> closed-fixed
     
  • Stefan Pinnow

    Stefan Pinnow - 2018-12-23

    Thank you for reporting. The bug is fixed now.

     
MongoDB Logo MongoDB