# How to remove the protrude of the path with arrow?

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}

• Do you need a decoration for that? Just do -{Stealth[scale=0.8]} at that path and PGF/TikZ will handle the tip correctly. Dec 14, 2022 at 15:18
• @Qrrbrbirlbel sorry where should I add that in the code? Dec 14, 2022 at 15:22
• \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. The markings decoration is only needed if you need an arrow tip somewhere else. Dec 14, 2022 at 15:35
• @Qrrbrbirlbel that is nice. It would be best if you put that as an answer so we can refer it later (although it would be great if decoration works as well). Dec 14, 2022 at 15:41

\draw[-{Stealth[scale=0.8]}, ultra thick, red!40, transform canvas={yshift=3pt}] (start) -- (end);

\draw[ultra thick, red!40, postaction={decorate}, transform canvas={yshift=3pt}, shorten >=2pt] (start) --(end);

• It's nice to know shorten. Dec 14, 2022 at 17:40
• Notice that the option is not shorten but shorten > (or shorten < for the other end). Dec 14, 2022 at 17:44