From this code is from an answer to my previous post. The arrow is nice but if I want to move the arrow to the end of the path by setting mark = at position 1
there is still a protrude part which doesn't look nice.
Is there any idea to remove this part?
\documentclass[tikz, border=1cm]{standalone}
\usepackage[american, siunitx, RPvoltages]{circuitikz}
\usetikzlibrary{decorations.markings, arrows.meta}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}
\ctikzset{inductors/scale=0.5, capacitors/scale=0.5, sources/scale=0.5, switches/scale=0.5}
\draw (0,0) coordinate (start) node[ocirc]{} to [cute open switch]
++(1,0) to [cute inductor, l^=$L$] ++(1,0) to [short]++(0.5,0) node[ocirc]{} coordinate (end);
\begin{scope}[on background layer, decoration={
markings, mark=at position 1 with {\arrow{Stealth[scale=0.8]}}} ]
\draw[ultra thick, red!40, postaction={decorate}, transform canvas={yshift=3pt}] (start) --(end);
\end{scope}
\end{tikzpicture}
\end{document}
-{Stealth[scale=0.8]}
at that path and PGF/TikZ will handle the tip correctly.\begin{scope}[on background layer]\draw[ultra thick, red!40, -{Stealth[scale=0.8]}, transform canvas={yshift=3pt}] (start) -- (end);\end{scope}
. No need for the decoration if you want to just use an arrow tip at the end of a line, that's the original usecase. Themarkings
decoration is only needed if you need an arrow tip somewhere else.