summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex94
1 files changed, 71 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex
index 494f328994d..b6e8140abe3 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex
@@ -1,10 +1,13 @@
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseshapes.code.tex,v 1.9 2005/10/13 10:12:31 tantau Exp $
-
-% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>.
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
%
-% This program can be redistributed and/or modified under the terms
-% of the GNU Public License, version 2.
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseshapes.code.tex,v 1.14 2006/10/11 15:22:25 tantau Exp $
\newbox\pgfnodeparttextbox
@@ -33,11 +36,11 @@
% \pgfmultipartnode{rectangle}{center}{Hello}{hellonode}{\pgfusepath{stroke}}
\def\pgfmultipartnode#1#2#3#4{%
- \@ifundefined{pgf@sh@s@#1}%
+ \pgf@ifundefined{pgf@sh@s@#1}%
{\PackageError{pgf}{Unknown shape ``#1''}{}}%
{%
{%
- \let\pgf@sh@savedpoints=\@empty%
+ \let\pgf@sh@savedpoints=\pgf@empty%
\csname pgf@sh@s@#1\endcsname%
\pgf@sh@savedpoints%
\pgftransformshift{%
@@ -47,19 +50,20 @@
}%
% Save the saved points and the transformation matrix
\edef\pgf@test{#3}%
- \ifx\pgf@test\@empty%
+ \ifx\pgf@test\pgf@empty%
\else%
\expandafter\xdef\csname pgf@sh@ns@#3\endcsname{#1}%
\edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@np@#3\endcsname}%
\expandafter\pgf@sh@@temp\expandafter{\pgf@sh@savedpoints}%
\pgfgettransform\pgf@temp
\expandafter\xdef\csname pgf@sh@nt@#3\endcsname{\pgf@temp}%
+ \expandafter\xdef\csname pgf@sh@pi@#3\endcsname{\pgfpictureid}%
\fi%
- \@ifundefined{pgf@sh@bbg@#1}{}
+ \pgf@ifundefined{pgf@sh@bbg@#1}{}
{{\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope}}%
- \@ifundefined{pgf@sh@bg@#1}{}%
+ \pgf@ifundefined{pgf@sh@bg@#1}{}%
{\csname pgf@sh@bg@#1\endcsname#4}%
- \@ifundefined{pgf@sh@fbg@#1}{}
+ \pgf@ifundefined{pgf@sh@fbg@#1}{}
{{\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope}}%
{%
\expandafter\@for\expandafter\pgf@shape@com\expandafter:\expandafter=\csname pgf@sh@boxes@#1\endcsname\do{%
@@ -69,11 +73,11 @@
}%
}%
}%
- \@ifundefined{pgf@sh@bfg@#1}{}%
+ \pgf@ifundefined{pgf@sh@bfg@#1}{}%
{{\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope}}%
- \@ifundefined{pgf@sh@fg@#1}{}%
+ \pgf@ifundefined{pgf@sh@fg@#1}{}%
{\csname pgf@sh@fg@#1\endcsname#4}%
- \@ifundefined{pgf@sh@ffg@#1}{}%
+ \pgf@ifundefined{pgf@sh@ffg@#1}{}%
{{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}%
}%
}%
@@ -115,7 +119,7 @@
\def\pgf@sh@resavedanchor#1#2{%
\pgf@process{#2}%
\edef\pgf@sh@marshal{%
- \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{%
+ \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{%
\noexpand\def\noexpand#1{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
}}%
\pgf@sh@marshal%
@@ -125,7 +129,7 @@
\def\pgf@sh@resaveddimen#1#2{%
{#2\global\pgf@x=\pgf@x}%
\edef\pgf@sh@marshal{%
- \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{%
+ \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{%
\noexpand\def\noexpand#1{\the\pgf@x}%
}}%
\pgf@sh@marshal%
@@ -133,7 +137,7 @@
% Invoke an anchor
\def\pgf@sh@reanchor#1#2{%
- \@ifundefined{pgf@anchor@#1@#2}%
+ \pgf@ifundefined{pgf@anchor@#1@#2}%
{%
\setcounter{pgf@counta}{#2}%
\csname pgf@anchor@#1@border\endcsname{\pgfpointpolar{\c@pgf@counta}{1pt}}%
@@ -159,7 +163,7 @@
\def\pgfpointanchor#1#2{%
% Ok, check whether #1 is known!
- \@ifundefined{pgf@sh@ns@#1}
+ \pgf@ifundefined{pgf@sh@ns@#1}
{\PackageError{pgf}{No shape named #1 is known}{}%
\pgfpointorigin}%
{%
@@ -173,6 +177,8 @@
\global\pgf@x=\pgf@x%
\global\pgf@y=\pgf@y%
}%
+ % Add inter picture transformation
+ \pgf@shape@interpictureshift{#1}%
% Undo current transformation
\pgftransforminvert%
\pgf@pos@transform{\pgf@x}{\pgf@y}%
@@ -180,6 +186,24 @@
}%
}
+\def\pgf@shape@interpictureshift#1{%
+ \expandafter\ifx\csname pgf@sh@pi@#1\endcsname\pgfpictureid%
+ \else%
+ \pgfsys@getposition{\csname pgf@sh@pi@#1\endcsname}\pgf@shape@original@pos%
+ \pgfsys@getposition{\pgfpictureid}\pgf@shape@current@pos%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointorigin\pgf@shape@current@pos}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgf@process{\pgfpointorigin\pgf@shape@original@pos}%
+ \advance\pgf@xa by\pgf@x%
+ \advance\pgf@ya by\pgf@y%
+ \pgf@x=\pgf@xa%
+ \pgf@y=\pgf@ya%
+ \fi%
+}
+
% Retrieves a border point of a shape
@@ -201,7 +225,7 @@
\def\pgfpointshapeborder#1#2{%
% Ok, check whether #1 is known!
- \@ifundefined{pgf@sh@ns@#1}
+ \pgf@ifundefined{pgf@sh@ns@#1}
{\PackageError{pgf}{No shape named #1 is known}{}%
\pgfpointorigin}%
{%
@@ -216,6 +240,7 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @center\endcsname}%
+ \pgf@process{\pgf@shape@interpictureshift{#1}}%%
\advance\pgf@xa by-\pgf@x%
\advance\pgf@ya by-\pgf@y%
\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname{\pgfpoint{\pgf@xa}{\pgf@ya}}%
@@ -224,6 +249,8 @@
\global\pgf@x=\pgf@x%
\global\pgf@y=\pgf@y%
}%
+ % Add inter picture transformation
+ \pgf@shape@interpictureshift{#1}%
% Undo current transformation
\pgftransforminvert%
\pgf@pos@transform{\pgf@x}{\pgf@y}%
@@ -326,15 +353,15 @@
\anchorborder{\csname pgf@anchor@#1@center\endcsname}%
\anchor{text}{\pgfpointorigin}%
\nodeparts{text}%
- \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\@empty%
+ \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\pgf@empty%
#2
}
}
\def\pgf@sh@savedanchor#1#2{%
- \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}}
+ \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}}
\def\pgf@sh@saveddimen#1#2{%
- \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}}
+ \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}}
\def\pgf@sh@anchor#1#2{\expandafter\gdef\csname pgf@anchor@\shape@name @#1\endcsname{#2}}
\def\pgf@sh@anchorborder#1{\expandafter\gdef\csname pgf@anchor@\shape@name @border\endcsname##1{\pgf@process{##1}#1}}
\long\def\pgf@sh@behindbgpath#1{\expandafter\gdef\csname pgf@sh@bbg@\shape@name\endcsname{#1}}
@@ -346,7 +373,7 @@
\def\pgf@sh@boxes#1{\expandafter\gdef\csname pgf@sh@boxes@\shape@name\endcsname{#1}}
\def\pgf@sh@inheritsavedanchors[from=#1]{%
- \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}}
+ \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}}
\def\pgf@sh@inheritanchor[from=#1]#2{%
\edef\pgf@marshal{\global\let\expandafter\noexpand\csname
pgf@anchor@\shape@name @#2\endcsname=\expandafter\noexpand\csname
@@ -667,6 +694,27 @@
\def\northeast{\pgfpoint{\pgf@picmaxx}{\pgf@picmaxy}}%
}
\expandafter\def\csname pgf@sh@nt@current bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}}
+\expandafter\def\csname pgf@sh@pi@current bounding box\endcsname{\pgfpictureid}
+
+
+% Special current path bounding box rectangle:
+\expandafter\def\csname pgf@sh@ns@current path bounding box\endcsname{rectangle}
+\expandafter\def\csname pgf@sh@np@current path bounding box\endcsname{%
+ \def\southwest{\pgfpoint{\pgf@pathminx}{\pgf@pathminy}}%
+ \def\northeast{\pgfpoint{\pgf@pathmaxx}{\pgf@pathmaxy}}%
+}
+\expandafter\def\csname pgf@sh@nt@current path bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}}
+\expandafter\def\csname pgf@sh@pi@current path bounding box\endcsname{\pgfpictureid}
+
+
+% Special current page bounding box rectangle:
+\expandafter\def\csname pgf@sh@ns@current page\endcsname{rectangle}
+\expandafter\def\csname pgf@sh@np@current page\endcsname{%
+ \def\southwest{\pgfpoint{0pt}{0pt}}%
+ \def\northeast{\pgfpoint{\paperwidth}{\paperheight}}%
+}
+\expandafter\def\csname pgf@sh@nt@current page\endcsname{{1}{0}{0}{1}{0pt}{0pt}}
+\expandafter\def\csname pgf@sh@pi@current page\endcsname{pgfpageorigin}