2

I'd like to draw dashed lines from the right (east) border of one rectangle to the west anchor of two other rectangles, but the line should be horizontal. Is there an elegant way to decide where the line should start? See the following image as a clarification: the delta node should have two horizontal arrows pointing to the a_h and a_l boxes. I've played around with angles, which is almost impossible to get right because I can only estimate the correct value and it's unlikely to serve as a perfect match for the starting point of the arrow.

Current example code:

\begin{tikzpicture}
    [
        inverter/.style={rectangle,draw,inner sep=2pt,minimum size=6mm},
        dot/.style={circle,inner sep=0pt,minimum size=0.5mm,draw,fill=black}
    ]
    \node (x) at (0,0) {$x$};
    \node (delta) at (1,0) [shape=rectangle,draw,minimum height=18mm,minimum width=6mm] {$\delta$};

    \node(ah)     at ( 2,  0.5) [inverter] {$a_h$};
    \node(al)     at ( 2, -0.5) [inverter] {$a_l$};

    \draw [->,dashed,dash pattern=on 1pt off 1pt] (delta.58.75) -- (ah);
    \draw [->,dashed,dash pattern=on 1pt off 1pt] (delta.-58.75) -- (al);
\end{tikzpicture}

This code is clearly ugly and broken. It is easy to see that at least the upper arrow is by no means perfectly horizontal. How do I do it correctly?

Screenshot of the TikZ output

Rob
  • 311
  • 4
    You can get the orthogonal intersection of the east of delta and west of ah via \draw [->,dashed,dash pattern=on 1pt off 1pt] (delta.east|-ah) -- (ah); – percusse Jul 25 '13 at 18:07

0 Answers0