MWE:
% !TEX program = xelatex
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\pgfdeclarelayer{bg}
\pgfsetlayers{bg,main}
\begin{document}
\begin{tikzpicture}%
\node (first) {First};
\node (second) [below right=1cm of first] {Second};
\begin{pgfonlayer}{bg}%
\draw [->,rounded corners] (first.east) -| ($ (first.east-|second.north) + (0,-5mm) $) |- (second.north);
\draw [->,rounded corners] (second.west) -| ($ (second.west-|first.south) + (0,5mm) $) |- (first.south);
\end{pgfonlayer}
\end{tikzpicture}%
\end{document}
Result:
The arrow from second to first is rendered back to front and I can't figure out why. Can anyone enlighten me?
NOTE: if I disable rounded corners for that line then it renders the arrow correctly:
UPDATE: I can get it to render almost correctly by flipping the arrow head:
\draw [-<,rounded corners] (second.west) -| ($ (second.west-|first.south) + (0,5mm) $) |- (first.south);
Which displays:
However, now the arrow head is too close to the node's text.



