Is there any way to control whether the paths drawn by tikz path replacing inherit the styles of the original path? In trying to answer this question, I noticed that the thickness is (by default) not consistently inherited. In particular, thickness seems to be inherited by double lines and arrowheads, but not plain lines (possibly because those paths are produced by decorations themselves?). Other styles (e.g., color) mostly do not seem to be inherited at all. Is there a good way to pass all options to the replacement path?
\documentclass[tikz, border=5pt]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\tikzset{
z->/.style={
decoration={
show path construction,
lineto code={
\path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) coordinate[pos=.5] (mid);
\draw[double] (\tikzinputsegmentfirst) -- (mid);
\draw[->] (mid) -- (\tikzinputsegmentlast);
}
},decorate
}
}
\begin{document}
\begin{tikzpicture}
\draw [z->, red, thick] (0,0) -- (1,0);
\begin{scope}[red, thick]
\draw [z->] (0,.2) -- (1,.2);
\end{scope}
\end{tikzpicture}
\end{document}
I would like (or rather, expect) the first command and the second to produce the same output.