TikZ:如何使弯曲路径上的针变直?

TikZ:如何使弯曲路径上的针变直?

在这个 MWE 中,如何使针箭头变直并且独立于弯曲箭头形状的连接AB

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{arrows,chains}

\begin{document}
    \begin{tikzpicture}[
    start chain = going right,
    block/.style = {rectangle, draw, rounded corners, 
        text width=6em, align=center, minimum height=4em,
        on chain},
    every pin/.style = {inner sep=1mm, align=center, font=\footnotesize,
        pin distance=9mm, pin edge={angle 60-, solid, black}},
    ]
    \node[block] (A) {A};
    \node[block] (B) {B};

    \linespread{0.9}
    \draw[-latex'] (A) to[bend left] node[inner sep=0pt,
    pin=above:text] {}    (B);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

\documentclass[tikz,border=2mm]{standalone}
    \usetikzlibrary{arrows,chains}

\begin{document}
    \begin{tikzpicture}[
 start chain = going right,
block/.style = {rectangle, draw, rounded corners,
                text width=6em, align=center, minimum height=4em,
                on chain},
every pin/.style = {inner sep=1mm, align=center, font=\footnotesize,
                    pin distance=9mm, 
                    pin edge={angle 60-, 
                              line to, % added, now pin line is straight
                              black}},
                        ]
\node[block] (A) {A};
\node[block] (B) {B};

\linespread{0.9}
    \draw[-latex'] (A) to [bend left] node[inner sep=0pt,
                                pin=above:My very looooooong\\
                                text which is wider\\
                                than the arrow below] {}    (B);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容