我正在尝试让一个矩形节点适合其他两个节点。只要我不在封闭的 中设置xslant
和 ,这种方法就可以正常工作。在下面的示例中,封闭节点不适合和。yscale
scope
(n1)
(n2)
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{scopes,fit,backgrounds}
\begin{document}
\begin{tikzpicture}[scale=1,transform shape]
\tikzstyle{tA}=[draw,fill=red!10!yellow]
\tikzstyle{tB}=[draw,fill=red!30!yellow]
\tikzstyle{geom}=[xslant=1.5,yscale=0.5,rotate=0]
\begin{scope}[geom]
\node[tA] (n1) at (0,0) {A};
\node[tB] (n2) at (0,1) {A};
\node[tA] (n3) at (1,0) {A};
\node[tB] (n4) at (1,1) {A};
\node[fit=(n1) (n2), draw] {x};
\draw[blue,->] (n1.south) -- (n1.north); \draw[blue,->] (n2.south) -- (n2.north);
\end{scope}
\end{tikzpicture}
\end{document}
这就是我得到的(黑线):