-
Notifications
You must be signed in to change notification settings - Fork 110
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
bend left / bend right has wrong ending using “name prefix” #1251
Comments
Try this: \documentclass{minimal}
\usepackage{tikz}
\makeatletter
\def\tikz@@to@or@edge@@coordinate(#1){%
% before, \tikztotarget holds the coordinate unparsed
% \def\tikztotarget{#1}%
% after, \tikztotarget holds the parsed coordinate, hence `name prefix` and
% `name suffix` are taken into account
\tikz@scan@one@point\tikz@to@use@last@coordinate@as@target(#1)%
\tikz@to@or@edge@function% unchanged
}
\def\tikz@to@use@last@coordinate@as@target#1{%
\iftikz@shapeborder
\edef\tikztotarget{\tikz@shapeborder@name}%
\else
\edef\tikztotarget{\the\tikz@lastx,\the\tikz@lasty}%
\fi
}
\makeatother
\begin{document}
\begin{tikzpicture}[nodes={draw}, name prefix=pre]
\node (1) at (0,0) {1};
\node (2) at (-1,1){2};
\draw (1) to (2);
\draw[out=120, in=-30] (1) to (2);
\draw[out=90, in=-10] (1) to (pre2);
\draw[blue, bend left] (1) to (2);
\end{tikzpicture}
\end{document}
In \def\tikz@@@to@compute@relative#1{%
% ...
\begingroup
\pgfutil@ifundefined{pgf@sh@ns@\tikztostart}
{}% \tikztostart is not a node
{%
{%
% ...
\pgfpointshapeborder{\tikztostart}{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
% ...
}%
}%
\pgfutil@ifundefined{pgf@sh@ns@\tikztotarget}
{}% \tikztotarget is not a node
{%
{%
% ...
\pgfpointshapeborder{\tikztotarget}{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
% ...
}%
}%
\endgroup
} |
The original finder just confirmed that it works. Do you integrate the fix into the next release? |
Sure, though currently development of |
Brief outline of the bug
When an edge is bended using
bend left
orbend right
the line endings are not calculated correctly in combination withname prefix
and nodes. One end ends at the shape border, the other not. If the name is given explicitely, the line is drawn correctly.Example:
The left edge shows the error, while the right two edges show the correct behaviour.
I assume that the error is connected to the calculation or usage of
\tikz@second@point
in\tikz@@@to@compute@relative
.Minimal working example (MWE)
The text was updated successfully, but these errors were encountered: