次のような新しいノード タイプを作成しようとしています。
http://www.live-wtr.ru/leo/Tikz9.png
x3 = x1 + (x2 - x1) /2 の計算方法がわからない
ここで私はそれをやろうとしましたが、無駄でした。
\pgfdeclareshape{variant}{ \inheritsavedanchors[from=rectangle]
% this is nearly a rectangle
\inheritanchorborder[from=rectangle] \inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north} \inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west} \inheritanchor[from=rectangle]{east}
\backgroundpath{
%{{{ store lower left in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
%}}}
% compute x3 --- here is the problem!
\pgf@yc = \pgf@xb - \pgf@xa
\pgf@yc = 0.5\pgf@yc
\pgf@xc = \pgf@xa
\advance \pgf@xc by \pgf@yc
%end of the problem
\pgf@yc = \pgf@ya
\advance\pgf@yc by - 10pt % this should be a parameter
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
%{{{ construct 2 bottom lines
\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
%}}}
% Rectangle box
\pgfpathrectanglecorners{\southwest}{\northeast}
}
}