using an empiric solution :
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw,rounded corners,yellow,minimum height=1cm, minimum width=1cm] (A) {ABC};
\node[draw] (B) at (1,1) {B};
\coordinate[xshift=-0.3ex,yshift=-0.3ex] (fakeA) at (A.north east);
\draw [<->, blue] (fakeA) -- (B);
\draw [red] (A.north east) -- (B);
\end{tikzpicture}
\end{document}
you can't use A.xx
anchor: this point to the real rect. the rounded corner is a path operation.
A node in TikZ is made by two functions : first function wrote effectively the node using path operation, all path parameter can be passed to this command, and rounded corner is a path operation modifier.
The second function need a raytracer like operation. for each point this function should return the intersection point between the line (0,0) -- (this point) and the node.
third, node define some anchor, predefined position. this position are independent of path modifier operation.
With this facts, you have 3 solutions :
using rounded rectangle : like this
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\node[draw,rounded rectangle,yellow,minimum height=0.5cm, minimum width=1cm] (A) {ABC};
\node[draw] (B) at (1,1) {B};
\draw [<->, blue] (A) -- (B);
\end{tikzpicture}
\end{document}
But you don't have any way to specify the width and heigth of the rounded portion of the rectangle.
- Make your own shape that manage better the rounded part (really complicated, need some math knowledge (in raytracing function).
- Make some fake point like my example of previous example.
NB: you can't use the intersection TikZ library to found the correct point, I have already try it, this library don't really love the rounded corner.
rounded rectangle
from theshapes.misc
library. – Claudio Fiandrino Dec 18 '13 at 16:17