Say I have a simple rectangular node I wish to lengthen some sides of, such that they extend further from the corners. Simple, here is my attempt:
\documentclass[tikz,border=1mm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[draw] (x) {foo};
\draw (x.north west) -- ++(0, +1mm);
\end{tikzpicture}
\end{document}
The result:
I see what the problem is: x.north west
is exactly at the corner of the shape and draw
draws the line from this corner in such a way that the drawn path protrudes by pgflinewidth/2
in both directions along the trajectory I specified (if that makes sense; sorry, it is rather hard to explain).
My question is, how do I draw the line so that it looks like it extends the original side of the x
node?
- I suppose the
x.north east
anchor is where it is, there is no other anchor that just happens to be where I need it - One thing I thought of is making the
draw
command\draw[xshift=.5\pgflinewidth]
, but it did not cause any change and feels a bit hacky