我基于矩形创建了以下形状(它具有更多特征,但错误始终相同)。
\pgfdeclareshape{set}{
%Like in rectangle but without all the separators and height=width
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
\pgf@x=.5\pgf@xb%
\pgf@y=.5\pgf@xb%
}%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
\pgf@x=-.5\pgf@xb%
\pgf@y=-.5\pgf@xb%
}%
% Inherit from rectangle
\inheritanchorborder[from=rectangle]%
\inheritanchor[from=rectangle]{center}%
\inheritanchor[from=rectangle]{north}%
\inheritanchor[from=rectangle]{south}%
\inheritanchor[from=rectangle]{west}%
\inheritanchor[from=rectangle]{east}%
\inheritanchor[from=rectangle]{north west}%
\inheritanchor[from=rectangle]{north east}%
\inheritanchor[from=rectangle]{south west}%
\inheritanchor[from=rectangle]{south east}%
\backgroundpath{%
\pgfpathrectanglecorners{\southwest}{\northeast}%
}%
}%
大多数事情对我来说都很好。例如:
\node[set,draw, below right=10ex of n, rotate=270, anchor=center] (sA) {};
完美定位节点并旋转它。与“左下方”相同。
但如果我使用
\node[set,draw, above left=10ex of n, rotate=270, anchor=center] (sA) {};
我得到了错误
包 PGF 数学错误:未知函数“north”(在“north west”)。
“右上方”也发生同样的情况。输出似乎仍然很好。
我正在使用新版本的 tikz 3.0.0。
有什么方法可以避免这个真正令人不安的错误?
谢谢你!