[Tex/LaTex] TikZ: position of node with shorten-option

tikz-pgf

I have the following Code

\draw[style={shorten >=-1cm}, dashed] (C) -- (CENTER) node {NAME};

Is there a simple way to position {NAME} at the end of the "shortened" line? If I use the code above, it is placed at (CENTER).

Sebastian

Edit: I have no permission to answer my own question, so I write a short edit:

I think I found a solution that is feasible for my problem:

    \tikzset{%
        add/.style args={#1}{to path={%
        ($(\tikztostart)$)--($(\tikztotarget)!-#1!(\tikztostart)$)%
        \tikztonodes}}
    }

    \draw[dashed, add=1cm] (C) to (CENTER) node[right] {NAME};

Best Answer

You can use a xshift for the node and use the proper anchor:

\documentclass{article} 
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\coordinate (C) at (0,0);
\coordinate (CENTER) at (10,0);
\draw[style={shorten >=-1cm}, dashed] (C) -- (CENTER) node[xshift=1cm,anchor=west,inner sep=0pt] {NAME};
\end{tikzpicture}

\end{document}

enter image description here