-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\pgfpointanchor can insert spurious spaces if the anchor is an angle #946
Comments
This is not a MWE. |
Your fix does not work. |
Works on my machine. |
There are multiple spaces in the definitions of the anchors, the most common is the space after the opening
Some libraries don't have those spaces at all, others have
Here's a simpler MWE. Uncommenting any of the commented lines will place the circle at the correct point again. In my own code, I've chosen to use \documentclass[tikz]{standalone}
\pgfmathdeclarefunction{anglebetweencoordinates}{2}{%
\begingroup
% \nullfont
\pgfmathanglebetweenpoints
{\pgfpointanchor{#1}{center}}%
{\pgfpointanchor{#2}{center}}%
\pgfmathsmuggle\pgfmathresult
\endgroup
}
\usepackage{etoolbox}
\makeatletter
%\patchcmd\pgf@anchor@rectangle@center{ \pgf@process}{\pgf@process}{}{\PatchFailed}
\makeatother
\begin{document}
\begin{tikzpicture}[nodes=draw]
\node (A) at (0,0) {A}
node (B) at (30:1) {B};
\draw (A.{180+anglebetweencoordinates("A","B")}) circle[radius=2pt];
\end{tikzpicture}
\end{document} |
Brief outline of the bug
\pgfpointanchor
can insert spurious spaces if the anchor is an angle. This does not happen for "stringy" anchors likewest
.Minimal working example (MWE)
As you can see, the dashed red line gets shifted. This is not because the function uses strings (which is why there is a second picture with a function
test
). The problem is also absent if one uses nonnumerical anchors.The text was updated successfully, but these errors were encountered: