allow sloped/transform shape with non-identity transformation#1287
allow sloped/transform shape with non-identity transformation#1287Qrrbrbirlbel wants to merge 8 commits intopgf-tikz:masterfrom
Conversation
This applies the fixes of thinbold and muzimuzhi also to curves and lines while not globalize xc/yc for the line. Co-Authored-By: Yukai Chou <6376638+muzimuzhi@users.noreply.github.com> Co-Authored-By: Thin Bold <48164818+thinbold@users.noreply.github.com>
Co-Authored-By: Yukai Chou <6376638+muzimuzhi@users.noreply.github.com> Co-Authored-By: Thin Bold <48164818+thinbold@users.noreply.github.com>
doc/generic/pgf/CHANGELOG.md
Outdated
| - muzimuzhi | ||
| - Qrrbrbirlbel | ||
| - quark67 | ||
| - thinbold | ||
| - Yukai Chou (muzimuzhi) |
There was a problem hiding this comment.
I was already listed on line 30. 🤔
There was a problem hiding this comment.
Whoops, I didn't realize that. The recent update only had your nickname so I didn't even scan past the m …
| \def\pgftransformlineattime#1#2#3{% | ||
| \let\pgf@tempaa\pgf@pt@aa | ||
| \let\pgf@tempab\pgf@pt@ab | ||
| \let\pgf@tempba\pgf@pt@ba | ||
| \let\pgf@tempbb\pgf@pt@bb |
There was a problem hiding this comment.
The three pair of additions to \pgftransformlineattime, \pgftransformarcaxesattime, and \pgftransformcurveattime are so similar that maybe two new macros abstracting them correspondingly can be provided.
There was a problem hiding this comment.
Good idea, unfortunately \pgftransformlineattime uses \pgf@xc/\pgf@yc and \pgf@x/\pgf@y isn't save to use inbetween. I would just refactor that so that it uses x/y instead of xc/yc. (Too big of a change?)
That said, there's a lot more that they have in common.
I do know that there's that big #1116 delaying everything else (but I got impatient because it really gets in the way oftentimes – I do not know much about “a new test”, though, and what is required from me. |
|
Here's a
The, probably, legacy code of Here's a testfile with many transformations and all three types of paths (following the example of #1287). (And, as I now realize, this also shows that the name I've also adjusted the examples in the source since they either used deprecated macros ( \documentclass[tikz]{standalone}
\begin{document}
\tikzset{
every picture/.append style={
xscale=2, yscale=3,
xshift=40pt, yshift=50pt,
xslant=.2, yslant=-.3,
rotate=-35,
nodes=above,
execute at begin picture={
\draw[help lines, step=1] (0,0) grid (7,3);
\draw[thick, <->] (0,1) |- (1,0);}}}
%\makeatletter
%\let\iftikz@time@isdistance\iffalse
%\tikzset{
% pos/.code=\edef\tikz@time{#1}\pgfutil@ifxempty\tikz@time{}{%
% \pgfmathsetmacro\tikz@time{\tikz@time}%
% \let\iftikz@time@isdistance\ifpgfmathunitsdeclared}}
%\def\tikz@timer@line{%
% \iftikz@time@isdistance
% \pgftransformlineatdistance{\tikz@time pt}{\tikz@timer@start}{\tikz@timer@end}%
% \else
% \pgftransformlineattime{\tikz@time}{\tikz@timer@start}{\tikz@timer@end}%
% \fi}%
%\def\pgftransformlineatdistance#1#2#3{%
% \pgftransform@commonattime{\pgfpointlineatdistance{#1}{#2}{#3}}{\pgf@x=\pgf@xa\pgf@y=\pgf@ya}}
%\makeatother
\begin{tikzpicture}
\draw (0, 0) -- node[sloped ] {\texttt{sloped} only} +(2, 2);
\draw (2, 0) -- node[ transform shape] {\texttt{transform shape} only} +(2, 2);
\draw (4, 0) -- node[sloped, transform shape] {\texttt{sloped} and \texttt{transform shape}} +(2, 2);
\end{tikzpicture}
%\begin{tikzpicture}[pos=2cm]
%\draw (0, 0) -- node[sloped ] {\texttt{sloped} only} +(2, 2);
%\draw (2, 0) -- node[ transform shape] {\texttt{transform shape} only} +(2, 2);
%\draw (4, 0) -- node[sloped, transform shape] {\texttt{sloped} and \texttt{transform shape}} +(2, 2);
%\end{tikzpicture}
\begin{tikzpicture}
\draw (0, 0) to[bend left] node[sloped ] {\texttt{sloped} only} +(2, 2);
\draw (2, 0) to[bend left] node[ transform shape] {\texttt{transform shape} only} +(2, 2);
\draw (4, 0) to[bend left] node[sloped, transform shape] {\texttt{sloped} and \texttt{transform shape}} +(2, 2);
\end{tikzpicture}
\begin{tikzpicture}[start angle=180, delta angle=-120, x radius=1.5, y radius=.75, nodes=midway]
\draw (0, 0) arc[] node[sloped ] {\texttt{sloped} only} ;
\draw (2, 0) arc[] node[ transform shape] {\texttt{transform shape} only} ;
\draw (4, 0) arc[] node[sloped, transform shape] {\texttt{sloped} and \texttt{transform shape}};
\end{tikzpicture}
\end{document} |
This applies the fixes of thinbold and muzimuzhi also to curves and lines while not globalize xc/yc for the line. Co-Authored-By: Yukai Chou <6376638+muzimuzhi@users.noreply.github.com> Co-Authored-By: Thin Bold <48164818+thinbold@users.noreply.github.com> Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com>
Co-Authored-By: Yukai Chou <6376638+muzimuzhi@users.noreply.github.com> Co-Authored-By: Thin Bold <48164818+thinbold@users.noreply.github.com> Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com>
Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com> Signoff Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com>
This applies the fixes of @thinbold and @muzimuzhi also to curves and arc while not globalize xc/yc for the line function.
In my opinion, this is not a breaking change because the previous behavior was never the intended way.
Motivation for this change
Fixes #1058
Checklist
Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead: