summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
committerKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
commit90ae413a94da014dbf7a6a8ab584f7c668483a5a (patch)
tree4e0528a2b2fb2004988e7fc804ea2f1354f1f5d5 /Master/texmf-dist/tex/generic/pgf/basiclayer
parent800cc56380d1edfe567a6a66bef13e8950eb2b0c (diff)
pgf 3.0.0
git-svn-id: svn://tug.org/texlive/trunk@33057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex1318
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex50
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex34
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex83
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex221
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex100
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex606
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex169
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex123
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex76
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex39
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex131
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex91
14 files changed, 2243 insertions, 819 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
index 19e73e0b44e..d0fdab957aa 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
@@ -1,4 +1,4 @@
-% Copyright 2006 by Till Tantau
+% Copyright 2006, 2013 by Till Tantau
%
% This file may be distributed and/or modified
%
@@ -7,406 +7,1061 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.11 2008/04/23 14:59:01 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.40 2013/11/07 15:45:46 tantau Exp $
-% Sets the end arrow
+
+% Define a new (meta) arrow or a shorthand
%
-% #1 = An arrow name
+% #1 = key--value pairs
%
-% Example:
+% Description:
%
-% \pgfsetarrowsend{stealth}
-
-\def\pgfsetarrowsend#1{\pgf@arrowset{end}{#1}}
-\def\pgf@arrowset#1#2{%
- \pgfutil@ifundefined{pgf@arrow@code@#2}
- {\PackageError{pgf}{Arrow #1 type ``#2'' unknown}{}}
- {%
- \edef\pgf@arrow@temp{#2}%
- \ifx\pgf@arrow@temp\pgfutil@empty% ah. clear!
- \expandafter\let\csname pgf@#1arrow\endcsname=\pgfutil@empty%
- \expandafter\let\csname pgf@shorten@#1\endcsname=\pgfutil@empty%
+% This command is used to define a new arrow tip kind. For more
+% details on the description of the keys, please see the pgfmanual.
+%
+% name = Name of the arrow. If the name contains a dash
+% (hyphen), the text before the hyphen is the start name
+% and the text behind it the end name.
+%
+% means = If set, none of the below options may be
+% given. The effect is that whenever the arrow is
+% used, it gets replaced by this "text", which is
+% parsed by the parser.
+%
+% setup code = Code that does "precomputations". These will be
+% executed only once for each combination of the
+% dependencies. At the end of this code, you can use
+% \savethe and \save to "save" computed values, which
+% will then be available inside the "code". Values needed
+% only for the "... end" keys and the convex hull do not
+% need to be saved since these are also executed only
+% once.
+% drawing code = Code for drawing the arrow. When the cache key is set to
+% true, which is the default, the code will be protocolled
+% and the resulting code is inserted using \pgflowlevelobj.
+% cache = Boolean that decides whether the arrow can be cached. The
+% default is true, so you have to say cache=false to switch
+% caching off. In this case, each time the arrow is drawn,
+% its code is simply executed. This allows you to put things
+% like text or shadings in arrow tips.
+% bending mode = Can be set to "orthogonal", "polar", or
+% "none". Defaults to "orthogonal".
+% defaults = A list of "default" options for the arrow tip. These
+% are executed as if they were given to the arrow tip in
+% brackets. This is useful for setting up default values.
+% parameters = A list of comma-separated macro names on whose values
+% the appearance of the arrow tip depends. When an arrow
+% tip is used, these macros are expanded. If an
+% arrow tip was already installed with the same macro
+% names (and caching is true), the cached code is
+% used. Note that when you use dimensions here, add \the.
+%
+% Inside the setup code, the following macros are available:
+%
+% \pgfarrowsettipend
+% The code should draw an arrow pointing "right along the x
+% axis". The "tip" key specifies how far the arrow goes
+% along the x axis, that is, it should be the x coordinate
+% of the very tip of the arrow. In previous versions this
+% was called the "right extend". The value passed to this
+% key should be some code that sets the dimension
+% "\pgfarrowresult", which is \let to be equal to
+% \pgf@x. A \relax will be added after the code provided
+% here, so you can write things like "\pgfarrowresult=1pt".
+% \pgfarrowsetbackend
+% The leftmost x-coordinate that is still part of the
+% arrow tip (the "back end" of the arrow"). This coordinate
+% will be used when multiple arrow tips are
+% composed. Defaults to 0pt.
+% \pgfarrowsetlineend
+% The x-coordinate where a line should stop inside the arrow
+% tip so that it gets "obscured" by the arrow. Defaults to 0pt.
+% \pgfarrowsetvisualtipend
+% When the arrow tip is drawn in flex mode, it is rotated
+% such that the x-coordinates of "visual tip end" and "visual
+% back end" lie on the path. Defaults to \pgfarrowsettipend.
+% \pgfarrowsetvisualbackend
+% See above. Defaults to \pgfarrowsetbackend
+
+\def\pgfdeclarearrow#1{%
+ \let\pgf@decl@arrow@defaults\pgfutil@empty%
+ \let\pgf@decl@arrow@means\relax%
+ \let\pgf@decl@arrow@code\relax%
+ \pgfkeys{/pgf/@arrows decl/.cd,
+ name=,
+ setup code=,
+ cache=true,
+ bending mode=orthogonal,
+ parameters=,%
+ #1%
+ }%
+ \ifx\pgf@decl@arrow@name@end\pgfutil@empty%
+ \pgferror{Declaring unnamed arrow}%
+ \else%
+ \pgf@arrow@letter{name@end}%
+ \pgf@arrow@letter{name@start}%
+ \expandafter\let\csname pgf@ar@start@\pgf@decl@arrow@name@start\endcsname\pgf@decl@arrow@name@end%
+ \expandafter\let\expandafter\pgf@old@code\csname pgf@ar@code@\pgf@decl@arrow@name@end\endcsname%
+ \expandafter\let\expandafter\pgf@old@means\csname pgf@ar@means@\pgf@decl@arrow@name@end\endcsname%
+ \ifx\pgf@decl@arrow@code\relax%
+ \ifx\pgf@decl@arrow@means\relax%
+ \pgferror{You must set either the 'means' or the drawing code' keys for arrow tip '\pgf@decl@arrow@name@end'}%
+ \else%
+ \ifx\pgf@old@code\relax%
+ \let\pgf@arrow@tip@sequence\pgfutil@empty%
+ \let\pgf@arrow@translate\relax%
+ \expandafter\let\expandafter\pgf@arrows@direct\csname pgf@arrows@direct@name@end@\pgf@decl@arrow@means\endcsname%
+ \ifx\pgf@arrows@direct\relax%
+ \let\pgf@arrows@options\pgfutil@empty%
+ \expandafter\pgfarrows@initial@parser\pgf@decl@arrow@means[]\pgf@stop%
+ \else%
+ \let\pgf@arrow@tip@sequence\pgf@arrows@direct%
+ \fi%
+ \pgf@arrow@letter@\pgf@arrow@tip@sequence{means}%
+ \expandafter\let\csname pgf@ar@code@\pgf@decl@arrow@name@end\endcsname\relax%
+ \else%
+ \pgferror{Arrow tip '\pgf@decl@arrow@name@end' was already
+ defined with key 'drawing code' previously and you cannot change this}%
+ \fi%
+ \fi%
\else%
- %\pgf@arrow@prepare{#2}%
- \expandafter\def\csname pgf@#1arrow\endcsname{\pgf@arrow@call{#2}}%
- \expandafter\edef\csname pgf@shorten@#1\endcsname{\expandafter\noexpand\csname pgf@arrow@right@#2\endcsname}%
+ \ifx\pgf@decl@arrow@means\relax%
+ \ifx\pgf@old@means\relax%
+ \pgf@arrow@letter{code}%
+ \pgf@arrow@letter{defaults}%
+ \pgf@arrow@letter{setup}%
+ \pgf@arrow@letter{bending@mode}%
+ \pgf@arrow@letter{par}%
+ \expandafter\let\csname pgf@ar@do@cache@\pgf@decl@arrow@name@end\endcsname\pgf@decl@arrow@cache%
+ \else%
+ \pgferror{Arrow tip '\pgf@decl@arrow@name@end' was already
+ defined with key 'means' previously and you cannot change this}%
+ \fi%
+ \else%
+ \pgferror{You cannot set both the 'means' and also the 'drawing code'
+ keys for arrow tip '\pgf@decl@arrow@name@end'}%
+ \fi%
\fi%
+ \fi%
+}
+
+\def\pgf@arrow@letter#1{%
+ \expandafter\pgf@arrow@letter@\expandafter{\csname pgf@decl@arrow@#1\endcsname}{#1}%
+}
+\def\pgf@arrow@letter@#1#2{%
+ \expandafter\let\csname pgf@ar@#2@\pgf@decl@arrow@name@end\endcsname#1%
+}
+
+\pgfkeys{
+ /pgf/@arrows decl/.cd,
+ name/.code={%
+ \pgfutil@in@-{#1}%
+ \ifpgfutil@in@%
+ \pgf@arrows@name@decomp#1\pgf@stop%
+ \else%
+ \def\pgf@decl@arrow@name@end{#1}\let\pgf@decl@arrow@name@start\pgf@decl@arrow@name@end%
+ \fi},
+ means/.store in=\pgf@decl@arrow@means,
+ setup code/.store in=\pgf@decl@arrow@setup,
+ drawing code/.store in=\pgf@decl@arrow@code,
+ cache/.store in=\pgf@decl@arrow@cache,
+ bending mode/.is choice,
+ bending mode/none/.code=\let\pgf@decl@arrow@bending@mode\pgfutil@empty,
+ bending mode/orthogonal/.code=\def\pgf@decl@arrow@bending@mode{\pgfpointcurvilinearbezierorthogonal},
+ bending mode/polar/.code=\def\pgf@decl@arrow@bending@mode{\pgfpointcurvilinearbezierpolar},
+ parameters/.store in=\pgf@decl@arrow@par,
+ defaults/.code={%
+ \let\pgf@arrows@options\pgfutil@empty%
+ \pgfkeys{/pgf/arrow keys/.cd,#1}%
+ \let\pgf@decl@arrow@defaults\pgf@arrows@options%
+ }
+}
+
+\def\pgf@arrows@name@decomp#1-#2\pgf@stop{%
+ \def\pgf@decl@arrow@name@start{#1}%
+ \def\pgf@decl@arrow@name@end{#2}%
+}
+
+
+% Handler for defining arrow tips:
+%
+% Description:
+%
+% When you write "my name/.tip = arrow spec", this has the same
+% effect as writeing \pgfdeclarearrow{name = my name, means = arrow spec}.
+
+\pgfkeys{/handlers/.tip/.code=%
+ \expandafter\expandafter\expandafter\pgf@arrows@unravel\pgfkeyscurrentpath/\pgf@stop%
+ \expandafter\pgf@arrows@key@call\expandafter{\pgf@arrows@unravelled}{#1}}
+\def\pgf@arrows@unravel#1/{\pgfutil@ifnextchar\pgf@stop{\def\pgf@arrows@unravelled{#1}\pgfutil@gobble}{\pgf@arrows@unravel}}
+\def\pgf@arrows@key@call#1#2{\pgfdeclarearrow{name={#1},means={#2}}}
+
+
+
+
+% Draw an arrow
+%
+% #1 = arrow specification
+%
+% Description:
+%
+% Draws the arrow in the given specification (and "end"
+% specification). The arrow will be drawn such that it touches the
+% origin "from the left", that is, the arrow will lie completely in
+% the half plane with negative $x$ values and the tip will end exactly
+% at the origin.
+
+\def\pgfarrowdraw#1{%
+ {%
+ \pgfsetarrowsend{#1}%
+ \pgf@arrow@compute@shortening\pgf@end@tip@sequence%
+ \pgf@arrow@draw@arrow\pgf@end@tip@sequence\pgf@xb%
}%
}
-% Sets the start arrow
-%
-% #1 = An arrow name
-%
-% Example:
-%
-% \pgfsetarrowsstart{stealth}
-\def\pgfsetarrowsstart#1{\pgf@arrowset{start}{\csname pgf@arrows@invert#1\endcsname}}
+% Compute the length of an arrow
+%
+% #1 = arrow specification
+%
+% Description:
+%
+% In \pgf@x, this will return the total length of the arrow given as
+% #1, in \pgf@xa it will return the distance from the tip to the line
+% end.
+
+\def\pgfarrowtotallength#1{%
+ {%
+ \pgfsetarrowsend{#1}%
+ \pgf@arrow@compute@shortening\pgf@end@tip@sequence%
+ \expandafter\expandafter\expandafter%
+ }%
+ \expandafter\expandafter\expandafter\pgf@x\expandafter\the\expandafter\pgf@xb\expandafter\pgf@xa\the\pgf@xa%
+}
-\def\pgf@arrows@invname#1#2{\expandafter\def\csname pgf@arrows@invert#1\endcsname{#2}}
-\pgf@arrows@invname{}{}
-% Sets arrows
+% Sets the end arrow tip
%
-% #1 = An arrow specification of the form ``left''-``right''. The last
-% and right should be arrow types that have been defined using
-% the \pgfarrowsdef command
+% #1 = An arrow specification
%
-% Example:
+% Description:
+%
+% An "arrow specification" is a sequence of names of meta arrow tips
+% together with options in brackets. In detail:
+%
+% In #1, consider the text from the start up to the first bracket. If
+% this text is the name of a (meta) arrow tip, we use this arrow tip
+% with the provided options. If it is the name of a arrow tip
+% shorthand, this shorthand is expanded and the options are applied to
+% each arrow tip inside the shorthand. If the text is neither or the
+% above, the first letter of text is treated as a shorthand without
+% options.
+%
+% The special arrow tip "." is used to indicate the end of the line.
%
-% \pgfsetarrows{-to}
+% \pgfsetarrowsend{stealth[reversed]}
+% \pgfsetarrowsend{stealth[length=1pt] . stealth[length=2pt]}
+% \pgfsetarrowsend{>>>}
+% \pgfsetarrowsend{>.>}
+
+\def\pgfsetarrowsend#1{%
+ \let\pgf@arrow@tip@sequence\pgfutil@empty%
+ \pgf@arrows@translatefalse%
+ \expandafter\let\expandafter\pgf@arrows@direct\csname pgf@arrows@direct@name@end@#1\endcsname%
+ \ifx\pgf@arrows@direct\relax%
+ \edef\pgf@marshal{\noexpand\pgfarrows@initial@parser#1[]\noexpand\pgf@stop}%
+ \pgf@marshal%
+ \else%
+ \let\pgf@arrow@tip@sequence\pgf@arrows@direct%
+ \fi%
+ \let\pgf@end@tip@sequence\pgf@arrow@tip@sequence%
+}
-\def\pgfsetarrows#1{\pgf@arrows#1\pgf@stop}
-\def\pgf@arrows#1-#2\pgf@stop{%
- \pgfsetarrowsstart{#1}
- \pgfsetarrowsend{#2}
+\newif\ifpgf@arrows@translate
+
+\def\pgfarrows@initial@parser{%
+ \pgfutil@ifnextchar[\pgfarrows@initial@parser@{\pgfarrows@initial@parser@[]}}%}
+
+\def\pgfarrows@initial@parser@[#1]{%
+ \let\pgf@arrows@options\pgfutil@empty%
+ \pgfkeys{/pgf/arrow keys/.cd,#1}%
+ \let\pgf@arrows@options@initial\pgf@arrows@options%
+ \pgfarrows@parser%
}
-\def\pgf@arrows@checked#1#2#3{%
- \pgfutil@ifundefined{pgf@arrow@code@#2}%
- {%
- \PackageError{pgf}{Arrow end type ``#2'' unknown}{}}%
- {%
- \pgfutil@ifundefined{pgf@arrow@code@\csname pgf@arrows@invert#1\endcsname}
- {\PackageError{pgf}{Arrow start type ``#1'' unknown}{}}%
- {#3}%
- }%
+\def\pgfarrows@parser#1[{%
+ \pgfkeys@spdef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \let\pgf@next\pgf@arrows@empty%
+ \else%
+ \ifx\pgf@temp\pgf@dot@text%
+ \let\pgf@next\pgf@arrows@dot@parsed%
+ \else%
+ \let\pgf@untranslated\pgf@temp%
+ \ifpgf@arrows@translate%
+ \pgf@arrow@swapper%
+ \fi%
+ % Now, let's see what we do with this...
+ \expandafter\ifx\csname pgf@ar@code@\pgf@temp\endcsname\relax
+ \expandafter\ifx\csname pgf@ar@means@\pgf@temp\endcsname\relax
+ % #1 should start with a single-char shorthands
+ \let\pgf@next\pgf@arrows@single@char@parser%
+ \let\pgf@temp\pgf@untranslated%
+ \else%
+ % #1 is a shorthand!
+ \let\pgf@next\pgf@arrows@shorthand@parsed%
+ \fi%
+ \else%
+ % #1 is a meta arrow!
+ \let\pgf@next\pgf@arrows@meta@parsed%
+ \fi%
+ \fi%
+ \fi%
+ \expandafter\pgf@next\pgf@temp[%
+}
+
+\def\pgf@arrows@empty[#1]{%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+}
+
+\def\pgf@arrows@single@char@parser#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@dot@text%
+ \let\pgf@next\pgf@arrows@dot@parsed%
+ \else%
+ \let\pgf@untranslated\pgf@temp%
+ \ifpgf@arrows@translate%
+ \pgf@arrow@swapper%
+ \fi%
+ \expandafter\ifx\csname pgf@ar@code@\pgf@temp\endcsname\relax
+ \expandafter\ifx\csname pgf@ar@means@\pgf@temp\endcsname\relax
+ \let\pgf@temp\pgf@untranslated%
+ \let\pgf@next\pgf@arrows@unknown%
+ \else%
+ \let\pgf@next\pgf@arrows@shorthand@parsed%
+ \fi%
+ \else%
+ \let\pgf@next\pgf@arrows@meta@parsed%
+ \fi
+ \fi
+ \expandafter\pgf@next\pgf@temp[]%
+}
+\def\pgf@arrows@unknown#1[]#2[#3]{%
+ \pgferror{Unknown arrow tip kind '#1#2'}%
}
-\def\pgf@arrows@check@already#1#2#3{%
- \pgfutil@ifundefined{pgf@arrow@code@#2}
- {#3}%
- {\PackageError{pgf}{Arrow end type ``#2'' already defined}{}}%
+\def\pgf@arrows@meta@parsed#1[#2]{%
+ % Ok, run the keys #2. This will add commands to \pgf@arrows@options:
+ %
+ \let\pgf@arrows@options\pgf@arrows@options@initial%
+ \pgfkeys{/pgf/arrow keys/.cd,#2}%
+ % Append the arrow and its options to the arrow tip sequence:
+ \expandafter\pgf@arrows@meta@set\expandafter{\pgf@arrows@options}{#1}{\pgf@arrow@handle}%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
}
+\def\pgf@arrows@parser@done#1{%
+}
-% Called when an arrow needs to be rendered
+\def\pgf@arrows@dot@parsed#1[#2]{%
+ \pgf@arrows@append@to@tips{\pgf@arrow@handle@dot}%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+}
-\def\pgf@arrow@call#1{%
- \expandafter\ifx\csname\pgf@arrow@full@name{#1}\endcsname\relax%
- \pgfsysprotocol@getcurrentprotocol\pgf@arrow@temp%
- {%
- \pgfinterruptpath%
- \let\pgfusepath=\pgf@nousepath@here%
- \pgf@relevantforpicturesizefalse%
- \pgftransformreset%
- \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
- \pgfsysprotocol@bufferedtrue%
- \pgfsys@beginscope%
- \csname pgf@arrow@code@#1\endcsname%
- \pgfsys@endscope%
- \pgfsysprotocol@getcurrentprotocol\pgf@@arrow@temp%
- \global\let\pgf@@arrow@temp=\pgf@@arrow@temp%
- \endpgfinterruptpath%
- \expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\pgfsys@invoke\expandafter{\pgf@@arrow@temp}}%
- \expandafter\global\expandafter\let\csname\pgf@arrow@full@name{#1}\endcsname=\pgf@temp%
- }%
- \pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp%
+\def\pgf@arrows@meta@set#1#2#3{%
+ \pgf@arrows@append@to@tips{#3{#2}{#1}}%
+}
+\def\pgf@arrows@append@to@tips#1{%
+ \let\pgf@tempa\pgf@arrow@tip@sequence%
+ \def\pgf@tempb{#1}%
+ \ifpgf@arrows@translate%
+ \let\pgf@tempa\pgf@tempb%
+ \let\pgf@tempb\pgf@arrow@tip@sequence%
+ \fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrow@tip@sequence%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@tempa\pgf@tempb}%
+}
+
+\def\pgf@arrows@shorthand@parsed#1[#2]{%
+ \let\pgf@arrows@options\pgf@arrows@options@initial%
+ \pgfkeys{/pgf/arrow keys/.cd,#2}%
+ \ifx\pgf@arrows@options\pgfutil@empty%
+ \expandafter\pgf@arrows@append@to@tips\expandafter{%
+ \expandafter\pgf@arrow@handle@shorthand@empty\expandafter{\csname pgf@ar@means@#1\endcsname}}%
+ \else%
+ \expandafter\expandafter\expandafter\pgf@arrows@meta@set\expandafter\expandafter\expandafter{%
+ \expandafter\pgf@arrows@options\expandafter}\expandafter{\csname pgf@ar@means@#1\endcsname}{\pgf@arrow@handle@shorthand}%
\fi%
- \csname\pgf@arrow@full@name{#1}\endcsname%
-}
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+}
+
-\def\pgf@arrow@full@name#1{pgf@arrow@prot@#1@\the\pgflinewidth @\pgfinnerlinewidth @\pgfgetarrowoptions{#1}}
+% General handler:
-\def\pgf@arrow@code@{} % dummy
+\def\pgf@arrow@handle@shorthand@empty#1{#1}
-\def\pgf@nousepath@here#1{%
- \PackageError{pgf}{The definition of an arrow may not use \string\pgfusepath}{}
+\def\pgf@arrow@handle@shorthand#1#2{%
+ \def\pgf@temp@opt{#2}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrows@nested@options@temp%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@temp@opt\pgf@arrows@nested@options}%
+ \expandafter\let\expandafter\pgf@arrows@nested@options\expandafter\pgf@arrows@nested@options@temp%
+ \expandafter#1% all these expandafters to avoid creating groups, but having the options nest
+ \expandafter\def\expandafter\pgf@arrows@nested@options\expandafter{\pgf@arrows@nested@options}%
}
+\let\pgf@arrows@nested@options\pgfutil@empty
+
+
-% Get options for an arrow
+
+% Sets the start arrow tip
%
-% #1 = arrow tip name
+% #1 = An arrow specification
%
% Description:
+%
+% This works like \pgfsetarrowsend, only the order of the tips in the
+% arrow specification is reversed and the "reversed names" are used.
%
-% For every arrow tip certain options can be set, which may influence
-% the appearance of the arrow tip. How the options are used is up the
-% arrow tip code. This command will expand to the current value of
-% the options for this tip. The default is 0.
+% \pgfsetarrowsend{<<}
+% \pgfsetarrowsend{>.>}
+
+\def\pgfsetarrowsstart#1{%
+ \let\pgf@arrow@tip@sequence\pgfutil@empty%
+ \pgf@arrows@translatetrue%
+ \expandafter\let\expandafter\pgf@arrows@direct\csname pgf@arrows@direct@name@start@#1\endcsname%
+ \ifx\pgf@arrows@direct\relax%
+ \edef\pgf@marshal{\noexpand\pgfarrows@initial@parser#1[]\noexpand\pgf@stop}%
+ \pgf@marshal%
+ \else%
+ \let\pgf@arrow@tip@sequence\pgf@arrows@direct%
+ \fi%
+ \let\pgf@start@tip@sequence\pgf@arrow@tip@sequence%
+}
-\def\pgfgetarrowoptions#1{%
- \expandafter\ifx\csname pgf@arrow@opt@#1\endcsname\relax0\else\csname pgf@arrow@opt@#1\endcsname\fi%
+\def\pgf@arrow@swapper{%
+ \expandafter\let\expandafter\pgf@temp\csname pgf@ar@start@\pgf@temp\endcsname%
+ \ifx\pgf@temp\relax%
+ \def\pgf@temp{undefined}%
+ \fi%
}
+\let\pgf@start@tip@sequence\pgfutil@empty
+\let\pgf@end@tip@sequence\pgfutil@empty
+
+
+\expandafter\def\csname pgf@arrows@direct@name@start@\endcsname{}
+\expandafter\def\csname pgf@arrows@direct@name@end@\endcsname{}
+
+
+% Predefined lengths and ifs
+
+\newdimen\pgfarrowsep
+
+\newif\ifpgfarrowswap
+\newif\ifpgfarrowreversed
+\newif\ifpgfarrowharpoon
+\newif\ifpgfarrowopen
+
+\let\pgf@arrows@stroke@color\pgfutil@empty
+\let\pgf@arrows@fill@color\pgfutil@empty
+
+\def\pgfarrows@length@scale{1}
+\def\pgfarrows@width@scale{1}
+\def\pgfarrows@slant{0}
+
+\let\pgfarrows@scale@list\pgfutil@empty
+\def\pgfarrowsaddtolengthscalelist#1{\expandafter\def\expandafter\pgfarrows@scale@list\expandafter{\pgfarrows@scale@list#1\pgfarrows@length@scale#1}}
+\def\pgfarrowsaddtowidthscalelist#1{\expandafter\def\expandafter\pgfarrows@scale@list\expandafter{\pgfarrows@scale@list#1\pgfarrows@width@scale#1}}
+
+\pgfkeys{
+ /pgf/arrow keys/.cd,
+ scale/.code={%
+ \pgfmathparse{#1}%
+ \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrows@length@scale\expandafter{\pgfmathresult}}%
+ \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrows@width@scale\expandafter{\pgfmathresult}}%
+ },
+ scale length/.code={\pgfmathparse{#1}\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrows@length@scale\expandafter{\pgfmathresult}}},
+ scale width/.code={\pgfmathparse{#1}\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrows@width@scale\expandafter{\pgfmathresult}}},
+ slant/.code={\pgfmathparse{#1}\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrows@slant\expandafter{\pgfmathresult}}},
+ sep/.code={
+ \pgfarrowsthreeparameters{#1}%
+ \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters\pgfarrowsep\pgf@x}%
+ },
+ sep/.default=0.88pt .3 1,
+ %
+ swap/.code=\pgfarrowsaddtooptions{\ifpgfarrowswap\pgfarrowswapfalse\else\pgfarrowswaptrue\fi},
+ reversed/.code=\pgfarrowsaddtooptions{\ifpgfarrowreversed\pgfarrowreversedfalse\else\pgfarrowreversedtrue\fi},
+ harpoon/.is choice,
+ harpoon/.default=true,
+ harpoon/true/.code=\pgfarrowsaddtooptions{\pgfarrowharpoontrue},
+ harpoon/false/.code=\pgfarrowsaddtooptions{\pgfarrowharpoonfalse},
+ left/.style={harpoon},
+ right/.style={harpoon,swap},
+ %
+ color/.code=\pgfarrowsaddtooptions{\def\pgf@arrows@stroke@color{#1}},
+ fill/.code={%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@nonetext%
+ \pgfarrowsaddtooptions{\pgfarrowopentrue}
+ \else
+ \pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}
+ \fi
+ },
+ fill/.value required,
+ open/.style={fill=none},
+ .unknown/.code={
+ \expandafter\pgfutil@in@\expandafter!\expandafter{\pgfkeyscurrentname}%
+ \ifpgfutil@in@%
+ % this is a color!
+ \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgf@arrows@stroke@color\expandafter{\pgfkeyscurrentname}}%
+ \else%
+ \pgfutil@doifcolorelse{\pgfkeyscurrentname}
+ {%
+ \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgf@arrows@stroke@color\expandafter{\pgfkeyscurrentname}}%
+ }
+ {%
+ \edef\pgf@temp{\pgfkeyscurrentname}%
+ \pgfkeys{/errors/unknown key/.expand once=\expandafter{\pgf@temp}{#1}}%
+ }
+ \fi
+ }
+}
+\def\pgf@nonetext{none}
-% Set options for an arrow
-%
-% #1 = arrow tip name
-% #2 = options
-%
-% Description:
-%
-% Sets the arrow tip options for an arrow. The options should be a
-% normal string and will be used to detect whether an arrow should be
-% recached. For instance, when you set the arrow tip options of
-% "myarrow" to "1", the arrow will be rendered in a certain way. Then,
-% when you set the options to "2", the arrow will be rerendered.
+\def\pgfarrowsaddtooptions#1{\expandafter\def\expandafter\pgf@arrows@options\expandafter{\pgf@arrows@options#1}}
+\def\pgfarrowsaddtolateoptions#1{\expandafter\def\expandafter\pgf@arrows@options\expandafter{\pgf@arrows@options\pgf@arrows@add@to@late@options{#1}}}
+\def\pgf@arrows@add@to@late@options#1{\expandafter\def\expandafter\pgf@arrows@late@options\expandafter{\pgf@arrows@late@options#1}}
-\def\pgfsetarrowoptions#1#2{%
- \expandafter\def\csname pgf@arrow@opt@#1\endcsname{#2}%
+
+
+\def\pgfarrowsthreeparameters#1{%
+ \pgfarrowsthreeparameters@#1 +0 +0 +0 \pgf@stop%
+}
+\def\pgfarrowsthreeparameters@#1 #2 #3 #4\pgf@stop{%
+ \pgfmathsetlength\pgf@x{#1}%
+ \pgfmathsetmacro\pgf@temp@a{#2}%
+ \pgfmathsetmacro\pgf@temp@b{#3}%
+ \edef\pgfarrowstheparameters{{\the\pgf@x}{\pgf@temp@a}{\pgf@temp@b}}%
}
+\def\pgfarrowsfourparameters#1{%
+ \pgfarrowsfourparameters@#1 +0 +0 +0 \pgf@stop%
+}
+\def\pgfarrowsfourparameters@#1:#2 #3 #4 #5\pgf@stop{%
+ \pgfmathsetmacro\pgf@temp@z{#1}%
+ \pgfmathsetlength\pgf@x{#2}%
+ \pgfmathsetmacro\pgf@temp@a{#3}%
+ \pgfmathsetmacro\pgf@temp@b{#4}%
+ \edef\pgfarrowstheparameters{{\pgf@temp@z}{\the\pgf@x}{\pgf@temp@a}{\pgf@temp@b}}%
+}
+\def\pgfarrows@angle@setup#1#2#3#4{%
+ \pgfarrowslinewidthdependent{#2}{#3}{#4}
+ \pgf@xc\pgf@x
+ \pgf@yc#1 pt%
+ \pgf@yc.5\pgf@yc%
+ \pgfpointpolar{\pgf@yc}{\pgf@xc}
+ \pgfarrowlength\pgf@x%
+ \pgf@y2\pgf@y%
+ \expandafter\pgf@arrows@add@to@late@options\expandafter{\expandafter\pgfarrowwidth\the\pgf@y}%
+}
+\def\pgfarrows@angle@setup@prime#1{%
+ \pgf@yc#1 pt%
+ \pgfmathtan@{.5\pgf@yc}%
+ \pgfarrowwidth\pgfmathresult\pgfarrowlength%
+ \pgfarrowwidth2\pgfarrowwidth%
+}
-% Define an arrow type.
-%
-% #1 = name or mnemonic for arrow when used at the start (examples: ``to'' or ``<'')
-% #2 = name or mnemonic for arrow when used at the end (examples: ``to'' or ``>'')
-% #3 = code to setup the left and right extend of the arrow. To set
-% the left extend, call \pgfarrowsleftextend, for the right \pgfarrowsrightextend.
-% #4 = protocolable code
-%
-% Description:
-%
-% When you define an arrow using this command, you must give two
-% names. The first is used for the arrow when it is ``at the start'',
-% the other when it is at the end. For example, a simple arrow might
-% have the names ``<'' and ``>'', though these particular names are
-% not used by pgf and left for the user.
-%
-% The code should be ``protocolable'' code. This means that it uses
-% only pretty simple commands.
-%
-% The arrow code will be protocolled once for each line width at which
-% the arrow is used. Thus, the code can (and often should) depend on
-% the line width.
-%
-% The arrow should ``point right'' in the coordinate system. The end
-% of the line at which the arrow should be drawn will be at the origin
-% of the coordinate system. The coordinate system will be scaled and
-% rotated appropriately before the arrow is drawn.
-%
-% The right extend of the arrow should be set to how much the arrow
-% ``protrudes over the right''. Prior to drawing the arrow, the line
-% will be shortened by this amount so that the arrow tip will exactly
-% touch the original right end of the unshortened line.
-%
-% The left extend specifies the leftmost point of the arrow. This is
-% important only if you use the swapping command, when this end is
-% used to compute the shortening.
-%
-% The definition of an arrow should normally take care of the fact
-% that the line cap of the main line may be a butt cap, a round cap or
-% a rect cap. In all cases, the arrow should ``cover'' the cap
-% completely or not at all.
-%
-% Example:
-%
-% \pgfarrowsdeclare{stealth}{stealth}
-% {
-% \pgfarrowsleftextend{-6\pgflinewidth}
-% \pgfarrowsrightextend{2\pgflinewidth}
-% {
-% \pgfpathmoveto{\pgfpoint{2\pgflinewidth}{0pt}}
-% \pgfpathlineto{\pgfpoint{-6\pgflinewidth}{4\pgflinewidth}}
-% \pgfpathlineto{\pgfpoint{-3\pgflinewidth}{0pt}}
-% \pgfpathlineto{\pgfpoint{-6\pgflinewidth}{-4\pgflinewidth}}
-% \pgfusepathqfill
-% }
+\def\pgfarrowslinewidthdependent#1#2#3{%
+ \pgf@x#1%
+ \ifdim\pgfinnerlinewidth>0pt%
+ \pgf@arrows@inner@line@width@dep{#2}{#3}%
+ \else%
+ \advance\pgf@x by#2\pgflinewidth%
+ \fi%
+}
+\def\pgf@arrows@inner@line@width@dep#1#2{%
+ % #1*((1-#2/2)*full line width - (#2/2) * inner line width)
+ % Compute "real" line width
+ \pgf@xa\pgflinewidth%
+ \pgf@xb-.5\pgflinewidth%
+ \pgf@xb#2\pgf@xb%
+ \advance\pgf@xa by\pgf@xb%
+ \pgf@xb\pgfinnerlinewidth%
+ \pgf@xb-.5\pgf@xb
+ \advance\pgf@xa by#2\pgf@xb%
+ \advance\pgf@x by#1\pgf@xa%
+}
-\def\pgfarrowsdeclare#1#2#3#4{%
- \pgf@arrows@check@already{#1}{#2}
- {%
- \expandafter\def\csname pgf@arrow@code@#2\endcsname{#4}%
- \expandafter\def\csname pgf@arrow@left@#2\endcsname{#3\advance\pgf@x by-\pgf@xa}%
- \expandafter\def\csname pgf@arrow@right@#2\endcsname{#3\advance\pgf@x by\pgf@xb}%
- \pgf@arrows@invname{#1}{#2}%
- }%
+
+\def\pgfarrowslengthdependent#1#2#3#4{%
+ #4#1%
+ \advance#4by#2\pgfarrowlength%
+ \advance#4by#3\pgflinewidth%
}
-\def\pgfarrowsleftextend#1{\pgfmathsetlength\pgf@xa{#1}}
-\def\pgfarrowsrightextend#1{\pgfmathsetlength\pgf@xb{#1}}
-\def\pgf@arrows@repeat#1#2{%
- \edef\pgf@arrows@marshal{\noexpand\let\expandafter\noexpand\csname#2\endcsname=\expandafter\noexpand\csname#1\endcsname}%
- \pgf@arrows@marshal}
+% Build the full name:
+\def\pgf@arrow@fullname#1{pgf@@ar@#1@\the\pgflinewidth @\pgfinnerlinewidth @\ifpgfarrowreversed r\fi @\pgf@arrows@stroke@color @\pgf@arrows@fill@color @\csname pgf@ar@par@#1\endcsname}
+\def\pgf@arrow@id@count{0}%
-% Declare a new arrow type to be the same as another one.
-%
-% #1 = name of new start
-% #2 = name or new end
-% #3 = name or old start
-% #4 = name or old end
-%
-% Example:
-%
-% \pgfarrowsdeclarealias{<}{>}{to}{to}
+% Compute the arrow id of an arrow
+%
+% #1 = arrow name
+% #2 = options
+%
+% Description:
+%
+% Returns the an id in \pgf@arrow@id that identifies the instantiation
+% of the given arrow. If the arrow was not instantiated, this happens now.
+
+\def\pgfarrows@getid#1#2{%
+ % Execute options:
+ \let\pgf@arrows@late@options\pgfutil@empty%
+ % 1. Defaults:
+ \csname pgf@ar@defaults@#1\endcsname%
+ % 2. Scope:
+ \pgf@arrows@options@scope
+ % 3. Local:
+ #2\relax%
+ % 4. Nested:
+ \pgf@arrows@nested@options%
+ % 5. Last options:
+ \pgf@arrows@late@options%
+ % 6. Scaling:
+ \pgfarrows@scale@list%
+ % Now, test:
+ \expandafter\global\expandafter\let\expandafter\pgf@arrow@id\csname\pgf@arrow@fullname{#1}\endcsname\relax%
+ \ifx\pgf@arrow@id\relax%
+ \pgf@arrows@instantiate{#1}
+ \fi%
+}
-\def\pgfarrowsdeclarealias#1#2#3#4{%
- \pgf@arrows@check@already{#1}{#2}
+\def\pgf@arrows@instantiate#1{%
+ % Not defined. Rats!
+ % Allocate new id:
+ \pgfutil@tempcnta\pgf@arrow@id@count\relax%
+ \advance\pgfutil@tempcnta by1\relax%
+ \xdef\pgf@arrow@id@count{\the\pgfutil@tempcnta}%
+ \expandafter\global\expandafter\let\csname\pgf@arrow@fullname{#1}\endcsname\pgf@arrow@id@count%
+ \global\let\pgf@arrow@id\pgf@arrow@id@count%
{%
- \pgf@arrows@checked{#3}{#4}%
- {%
- \pgf@arrows@repeat{pgf@arrow@code@#4}{pgf@arrow@code@#2}%
- \pgf@arrows@repeat{pgf@arrow@left@#4}{pgf@arrow@left@#2}%
- \pgf@arrows@repeat{pgf@arrow@right@#4}{pgf@arrow@right@#2}%
- \pgf@arrows@invname{#1}{#2}%
+ \csname pgf@ar@setup@#1\endcsname%
+ % Handle reversal
+ \ifpgfarrowreversed%
+ % Compute transformation:
+ \pgf@arrows@handle@reverse%
+ \fi%
+ % Save computed values
+ \expandafter\global\expandafter\let\csname pgf@ar@saves@\pgf@arrow@id\endcsname\pgf@arrows@saves%
+ \expandafter\global\expandafter\let\csname pgf@ar@hull@\pgf@arrow@id\endcsname\pgf@arrows@convexhull%
+ \expandafter\xdef\csname pgf@ar@ends@\pgf@arrow@id\endcsname{{\pgf@arrows@the@tipend}{\pgf@arrows@the@backend}{\pgf@arrows@the@lineend}}%
+ \expandafter\xdef\csname pgf@ar@visual@\pgf@arrow@id\endcsname{{\pgf@arrows@the@visualtipend}{\pgf@arrows@the@visualbackend}{}}%
+ % Save code (needed for bending)
+ \edef\pgf@arrow@code{%
+ \ifpgfarrowreversed\noexpand\pgftransformxscale{-1}\fi%
+ \expandafter\noexpand\csname pgf@ar@code@#1\endcsname%
}%
+ \expandafter\global\expandafter\let\csname pgf@ar@inst@code@\pgf@arrow@id\endcsname\pgf@arrow@code%
+ % Should we cache?
+ \expandafter\ifx\csname pgf@ar@do@cache@#1\endcsname\pgf@truetext%
+ \pgfsysprotocol@getcurrentprotocol\pgf@arrow@temp%
+ {%
+ \pgfinterruptpath%
+ \let\pgfusepath=\pgf@nousepath@here%
+ \pgf@relevantforpicturesizefalse%
+ \pgftransformreset%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+ \pgfsysprotocol@bufferedtrue%
+ \pgfscope%
+ \pgf@arrow@code%
+ \endpgfscope%
+ \pgfsysprotocol@getcurrentprotocol\pgf@@arrow@temp%
+ \expandafter\gdef\expandafter\pgf@arrow@code\expandafter{\expandafter\pgfsysprotocol@literal\expandafter{\pgf@@arrow@temp}}%
+ \endpgfinterruptpath%
+ }%
+ \pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp%
+ \fi%
+ \expandafter\global\expandafter\let\csname pgf@ar@cache@\pgf@arrow@id\endcsname\pgf@arrow@code%
}%
}
+\def\pgf@truetext{true}
+
+% Ok, now run setup:
+\def\pgf@arrows@copy@tipend{\pgf@arrows@the@tipend}
+\def\pgf@arrows@copy@backend{\pgf@arrows@the@backend}
+\def\pgf@arrows@copy@lineend{\pgf@arrows@the@lineend}
+\def\pgf@arrows@zeropt{0pt}%
+
+\let\pgf@arrows@saves\pgfutil@empty%
+\let\pgf@arrows@convexhull\pgfutil@empty%
+\let\pgf@arrows@the@tipend\pgf@arrows@zeropt%
+\let\pgf@arrows@the@backend\pgf@arrows@zeropt%
+\let\pgf@arrows@the@lineend\pgf@arrows@zeropt%
+\let\pgf@arrows@the@visualtipend\pgf@arrows@copy@tipend%
+\let\pgf@arrows@the@visualbackend\pgf@arrows@copy@backend%
+
+
+\def\pgf@arrows@handle@reverse{%
+ \pgf@x\pgf@arrows@the@visualtipend\pgf@x-\pgf@x%
+ \pgf@y\pgf@arrows@the@visualbackend\pgf@y-\pgf@y
+ \edef\pgf@arrows@the@visualtipend{\the\pgf@y}%
+ \edef\pgf@arrows@the@visualbackend{\the\pgf@x}%
+ \pgf@x\pgf@arrows@the@tipend\pgf@x-\pgf@x%
+ \pgf@y\pgf@arrows@the@backend\pgf@y-\pgf@y
+ \edef\pgf@arrows@the@tipend{\the\pgf@y}%
+ \edef\pgf@arrows@the@backend{\the\pgf@x}%
+ \pgf@x\pgf@arrows@the@lineend\pgf@x-\pgf@x\edef\pgf@arrows@the@lineend{\the\pgf@x}%
+ \let\pgf@temp\pgf@arrows@convexhull%
+ \let\pgf@arrows@convexhull\pgfutil@empty%
+ \let\pgf@arrow@hull@point\pgf@arrow@hull@point@reverse%
+ \pgf@temp%
+}
+\def\pgf@arrow@hull@point@reverse#1#2{%
+ \pgf@x#1%
+ \pgfarrowshullpoint{-\pgf@x}{#2}%
+}
+
+\def\pgf@nousepath@here#1{\pgferror{The definition of an arrow may not use \string\pgfusepath}}
+
+\def\pgfarrowssavethe#1{%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrows@saves%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@arrows@saves\expandafter#1\the#1\relax}
+}
+\def\pgfarrowssave#1{%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrows@saves%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@arrows@saves\expandafter\def\expandafter#1\expandafter{#1}}
+}
+\def\pgfarrowshullpoint#1#2{%
+ \pgf@x#1\relax%
+ \pgf@y#2\relax%
+ \edef\pgf@arrows@temp{\noexpand\pgf@arrows@convexhull\noexpand\pgf@arrow@hull@point{\the\pgf@x}{\the\pgf@y}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@arrows@convexhull\expandafter\expandafter\expandafter{\pgf@arrows@temp}%
+}
+\def\pgfarrowsupperhullpoint#1#2{%
+ \pgf@x#1\relax%
+ \pgf@y#2\relax%
+ \ifdim\pgf@y>0pt
+ \edef\pgf@arrows@temp{\noexpand\pgf@arrows@convexhull\noexpand\pgf@arrow@hull@point{\the\pgf@x}{\the\pgf@y}\ifpgfarrowharpoon\else\noexpand\pgf@arrow@hull@point{\the\pgf@x}{-\the\pgf@y}\fi}%
+ \else
+ \edef\pgf@arrows@temp{\noexpand\pgf@arrows@convexhull\noexpand\pgf@arrow@hull@point{\the\pgf@x}{\the\pgf@y}}%
+ \fi
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@arrows@convexhull\expandafter\expandafter\expandafter{\pgf@arrows@temp}%
+}
-% Creates a new arrows by ``swapping'' an existing arrow.
-%
-% #1 = name of new start
-% #2 = name of new end
-% #3 = name of old start
-% #4 = name of old end
-%
-% Example:
-%
-% \pgfarrowsdeclarealias{]}{[}{[}{]}
+\def\pgfarrowssettipend#1{\pgf@x#1\edef\pgf@arrows@the@tipend{\the\pgf@x}}
+\def\pgfarrowssetbackend#1{\pgf@x#1\edef\pgf@arrows@the@backend{\the\pgf@x}}
+\def\pgfarrowssetlineend#1{\pgf@x#1\edef\pgf@arrows@the@lineend{\the\pgf@x}}
+\def\pgfarrowssetvisualtipend#1{\pgf@x#1\edef\pgf@arrows@the@visualtipend{\the\pgf@x}}
+\def\pgfarrowssetvisualbackend#1{\pgf@x#1\edef\pgf@arrows@the@visualbackend{\the\pgf@x}}
-\def\pgfarrowsdeclarereversed#1#2#3#4{%
- \pgf@arrows@check@already{#1}{#2}%
- {%
- \pgf@arrows@checked{#3}{#4}%
- {%
- \expandafter\def\csname pgf@arrow@code@#2\endcsname{%
- \pgflowlevel{\pgftransformxscale{-1}}%
- \csname pgf@arrow@code@#4\endcsname}%
- \pgf@arrows@repeat{pgf@arrow@right@#4}{pgf@arrow@left@#2}%
- \pgf@arrows@repeat{pgf@arrow@left@#4}{pgf@arrow@right@#2}%
- \pgf@arrows@invname{#1}{#2}%
- }%
- }%
+
+% Internal computatin of the line end (shortening) for an arrow
+%
+% #1 = arrow tip list
+%
+% Description:
+%
+% \pgf@xa will contain the necessary path shortening for the given
+% arrow tip list, \pgf@xb will contain the total length of the arrow
+% tip list (sum of the differences between tip end and back end plus
+% the seps).
+
+\def\pgf@arrow@compute@shortening#1{%
+ \let\pgf@arrow@handle\pgf@arrow@compute@shortening@
+ \let\pgf@arrow@handle@dot\pgf@arrow@after@line@endtrue%
+ \pgf@arrow@after@line@endfalse%
+ \pgf@xa0pt%
+ \pgf@xb0pt%
+ #1%
+}
+\newif\ifpgf@arrow@after@line@end
+
+\def\pgf@arrow@compute@shortening@#1#2{%
+ {\pgfarrows@getid{#1}{#2}\ifnum\pgf@arrow@flex@mode>0\relax\global\pgf@precise@shorteningtrue\fi\expandafter}\expandafter\pgf@x\the\pgfarrowsep%
+ \expandafter\expandafter\expandafter\pgf@arrow@cont@short\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
+}
+\def\pgf@dot@text{.}
+
+\def\pgf@arrow@cont@short#1#2#3{% tip end, back end, line end, sep
+ \advance\pgf@xb by#1%
+ \pgf@xc#2%
+ \advance\pgf@xb by-\pgf@xc%
+ \advance\pgf@xb by\pgf@x%
+ \ifpgf@arrow@after@line@end%
+ \advance\pgf@xa by#1%
+ \advance\pgf@xa by\pgf@x%
+ \pgf@xc#2%
+ \advance\pgf@xa by-\pgf@xc%
+ \else%
+ \pgf@xa#1%
+ \advance\pgf@xa by\pgf@x%
+ \pgf@xc#3%
+ \advance\pgf@xa by-\pgf@xc%
+ \fi%
}
-% Creates new arrows by combining two existing arrows.
-%
-% #1 = optional additional space
-% #2 = name of new start
-% #3 = name of new end
-% #4 = name of second (innermost) start
-% #5 = name of second end
-% #6 = name of first (outermost) start
-% #7 = name of first end
-%
-% In the star form, the line will end at the innermost arrows,
-% otherwise the line will end at the outermost arrows.
-%
-% Example:
-%
-% \pgfarrowsdeclarecombine*{|<}{>|}{|}{|}{<}{>}
-% \pgfarrowsdeclarecombine{<<}{>>}{<}{>}{<}{>}
-\def\pgfarrowsdeclarecombine{\pgfutil@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}}
+% Draw an arrow
+%
+% #1 = arrow tip list
+% #2 = total length of the arrow (the value of \pgf@xb computed by
+% \pgf@arrow@compute@shortening)
+%
+% Description:
+%
+% Draws an arrow tip list. The coordinate system must have been
+% transformed so that the to-be-drawn arrow points right and should
+% "end" at the origin.
-\def\pgf@@arrowsdeclarecombine{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}}
-\def\pgf@arrowsdeclarecombine[#1]#2#3#4#5#6#7{%
- \pgf@arrows@check@already{#2}{#3}%
+\def\pgf@arrow@draw@arrow#1#2{%
{%
- \pgf@arrows@checked{#4}{#5}%
- {%
- \pgf@arrows@checked{#6}{#7}%
- {%
- \expandafter\edef\csname pgf@arrow@code@#3\endcsname{%
- \noexpand\pgfscope%
- {\expandafter\noexpand\csname pgf@arrow@code@#7\endcsname}%
- \noexpand\endpgfscope%
- {%
- \noexpand\pgfmathsetlength\pgf@x{#1}%
- \noexpand\pgf@process{\expandafter\noexpand\csname pgf@arrow@left@#7\endcsname}%
- \noexpand\pgf@process{\expandafter\noexpand\csname pgf@arrow@right@#5\endcsname}%
- \pgf@x=-\pgf@x%
- \noexpand\pgflowlevel{\noexpand\pgftransformxshift{\pgf@x}}%
- \expandafter\noexpand\csname pgf@arrow@code@#5\endcsname}%
- }%
- \pgf@arrows@repeat{pgf@arrow@right@#7}{pgf@arrow@right@#3}%
- \expandafter\def\csname pgf@arrow@left@#3\endcsname{%
- \pgf@process{%
- \pgfmathsetlength\pgf@y{#1}%
- \advance\pgf@x by\pgf@y%
- \pgf@process{\csname pgf@arrow@left@#7\endcsname}%
- \pgf@process{\csname pgf@arrow@right@#5\endcsname}%
- \pgf@process{\csname pgf@arrow@left@#5\endcsname}%
- }%
- }%
- \pgf@arrows@invname{#2}{#3}%
- }%
- }%
+ \pgf@xb=#2%
+ \pgftransformxshift{-\pgf@xb}%
+ \let\pgf@arrow@handle\pgf@arrow@drawer
+ \let\pgf@arrow@handle@dot\relax%
+ #1%
}%
}
-\def\pgfarrowsdeclarecombine@star*{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}}
-\def\pgf@arrowsdeclarecombine@star[#1]#2#3#4#5#6#7{%
- \pgf@arrows@check@already{#2}{#3}%
+
+\def\pgf@arrow@drawer#1#2{%
+ % Prepare:
{%
- \pgf@arrows@checked{#4}{#5}%
+ \pgfarrows@getid{#1}{#2}%
+ % Do shift:
+ \expandafter\expandafter\expandafter\pgf@arrow@drawer@shift\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
+ % Do slant:
+ \ifdim\pgfarrows@slant pt=0pt%
+ \else%
+ \pgftransformxslant{\pgfarrows@slant}%
+ \fi%
+ % do swap:
+ \ifpgfarrowswap%
+ \pgftransformyscale{-1}%
+ \fi%
{%
- \pgf@arrows@checked{#6}{#7}%
- {%
- \expandafter\edef\csname pgf@arrow@code@#3\endcsname{%
- \noexpand\pgfscope%
- {%
- \noexpand\pgfmathsetlength\pgf@x{#1}%
- \pgf@process{\expandafter\noexpand\csname pgf@arrow@left@#7\endcsname}%
- \pgf@process{\expandafter\noexpand\csname pgf@arrow@right@#5\endcsname}%
- \noexpand\pgflowlevel{\noexpand\pgftransformxshift{\pgf@x}}%
- }%
- {\expandafter\noexpand\csname pgf@arrow@code@#7\endcsname}%
- \noexpand\endpgfscope%
- \expandafter\noexpand\csname pgf@arrow@code@#5\endcsname%
- }%
- \pgf@arrows@repeat{pgf@arrow@left@#7}{pgf@arrow@left@#3}%
- \expandafter\def\csname pgf@arrow@right@#3\endcsname{%
- \pgf@process{%
- \pgfmathsetlength\pgf@y{#1}%
- \advance\pgf@x by\pgf@y%
- \pgf@process{\csname pgf@arrow@left@#7\endcsname}%
- \pgf@process{\csname pgf@arrow@right@#5\endcsname}%
- \pgf@process{\csname pgf@arrow@right@#7\endcsname}%
- }%
- }%
- \pgf@arrows@invname{#2}{#3}%
- }%
- }%
- }%
+ \csname pgf@ar@saves@\pgf@arrow@id\endcsname%
+ \pgfscope%
+ \pgf@arrows@color@setup%
+ \pgflowlevelsynccm\csname pgf@ar@cache@\pgf@arrow@id\endcsname%
+ \endpgfscope%
+ \pgf@arrows@rigid@hull%
+ }%
+ \expandafter}%
+ % Transform to next tip:
+ \expandafter\pgftransformxshift\expandafter{\the\pgf@xc}%
+}
+
+\def\pgf@arrows@color@setup{%
+ \ifx\pgf@arrows@stroke@color\pgfutil@empty\else\pgfsetstrokecolor{\pgf@arrows@stroke@color}\fi%
+ \ifx\pgf@arrows@fill@color\pgfutil@empty%
+ \expandafter\expandafter\expandafter\ifx%
+ \expandafter\csname\expandafter\string\expandafter\color@pgfstrokecolor\expandafter\endcsname\csname\string\color@pgffillcolor\endcsname%
+ \else
+ \pgfsetfillcolor{pgfstrokecolor}%
+ \fi%
+ \else%
+ \pgfsetfillcolor{\pgf@arrows@fill@color}%
+ \fi%
+}
+
+\def\pgf@arrow@drawer@shift#1#2#3{% tip end, back end, line end, sep
+ \pgf@xb#2\pgftransformxshift{-\pgf@xb}%
+ \pgf@xc#1%
+ \advance\pgf@xc by\pgfarrowsep%
+ \advance\pgf@xc by-\pgf@xb%
+}
+
+\def\pgf@arrows@rigid@hull{%
+ \ifpgf@relevantforpicturesize%
+ % Do bb update:
+ \expandafter\let\expandafter\pgf@temp\csname pgf@ar@hull@\pgf@arrow@id\endcsname%
+ \ifx\pgf@temp\pgfutil@empty\else%
+ \let\pgf@arrow@hull@point\pgf@arrow@hull@point@first%
+ \pgf@temp%
+ \pgf@arrow@update@bb%
+ \fi%
+ \fi
+}
+
+
+% Convex hull stuff:
+
+\def\pgf@arrow@hull@point@first#1#2{%
+% {\pgfsys@beginscope\pgfpathcircle{\pgfqpoint{#1}{#2}}{0.5pt}\pgfusepathqfill\pgfsys@endscope}%
+ \pgf@x#1\pgf@y#2%
+ \pgf@xa\pgf@pt@aa\pgf@x%
+ \advance\pgf@xa by\pgf@pt@ba\pgf@y%
+ \pgf@ya\pgf@pt@ab\pgf@x%
+ \advance\pgf@ya by\pgf@pt@bb\pgf@y%
+ \pgf@xb\pgf@xa\pgf@yb\pgf@ya%
+ \let\pgf@arrow@hull@point\pgf@arrow@hull@point@other%
+}
+\def\pgf@arrow@hull@point@other#1#2{%
+% {\pgfsys@beginscope\pgfpathcircle{\pgfqpoint{#1}{#2}}{0.5pt}\pgfusepathqfill\pgfsys@endscope}%
+ \pgfutil@tempdima#1\pgfutil@tempdimb#2%
+ \pgf@x\pgf@pt@aa\pgfutil@tempdima%
+ \advance\pgf@x by\pgf@pt@ba\pgfutil@tempdimb%
+ \pgf@y\pgf@pt@ab\pgfutil@tempdima%
+ \advance\pgf@y by\pgf@pt@bb\pgfutil@tempdimb%
+ \ifdim\pgf@x<\pgf@xa\pgf@xa\pgf@x\else\ifdim\pgf@x>\pgf@xb\pgf@xb\pgf@x\fi\fi%
+ \ifdim\pgf@y<\pgf@ya\pgf@ya\pgf@y\else\ifdim\pgf@y>\pgf@yb\pgf@yb\pgf@y\fi\fi%
}
+\def\pgf@arrow@update@bb{%
+ \advance\pgf@xa by\pgf@pt@x%
+ \advance\pgf@ya by\pgf@pt@y%
+ \advance\pgf@xb by\pgf@pt@x%
+ \advance\pgf@yb by\pgf@pt@y%
+ \ifdim\pgf@picmaxx=-16000pt\relax%
+ \global\pgf@picminx\pgf@xa%
+ \global\pgf@picmaxx\pgf@xb%
+ \global\pgf@picminy\pgf@ya%
+ \global\pgf@picmaxy\pgf@yb%
+ \else%
+ \ifdim\pgf@xa<\pgf@picminx\global\pgf@picminx\pgf@xa\fi%
+ \ifdim\pgf@ya<\pgf@picminy\global\pgf@picminy\pgf@ya\fi%
+ \ifdim\pgf@xb>\pgf@picmaxx\global\pgf@picmaxx\pgf@xb\fi%
+ \ifdim\pgf@yb>\pgf@picmaxy\global\pgf@picmaxy\pgf@yb\fi%
+ \fi%
+}
-% Creates new arrows by doubling/tripling existing arrows.
+% Sets arrows
%
-% #1 = optional additional space in multiples of line width
-% #2 = name of new start
-% #3 = name of new end
-% #4 = name of old start
-% #5 = name of old end
+% #1 = An arrow specification of the form
+% <start spec>-<end spec>. This will call \pgfsetstartarrow{start
+% spec} and \pgfsetendarrow{end spec}.
+%
+% Alternatively, it may be of the form [options]. In this case,
+% the arrow options are set for the local scope and all arrows in
+% the current scope will have these options set.
%
% Example:
%
-% \pgfarrowsdeclaredouble{<<}{>>}{<}{>}
+% \pgfsetarrows{-to}
-\def\pgfarrowsdeclaredouble{\pgfutil@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}}
-\def\pgf@arrowsdeclaredouble[#1]#2#3#4#5{\pgfarrowsdeclarecombine[#1]{#2}{#3}{#4}{#5}{#4}{#5}}
-\def\pgfarrowsdeclaretriple{\pgfutil@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}}
-\def\pgf@arrowsdeclaretriple[#1]#2#3#4#5{%
- \pgfarrowsdeclarecombine[#1]{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}{#4}{#5}%
- \pgfarrowsdeclarecombine[#1]{#2}{#3}{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}%
+\def\pgfsetarrows#1{\pgf@arrows#1\pgf@stop}
+\def\pgf@arrows{\pgfutil@ifnextchar[\pgf@arrows@test@opt\pgf@arrows@}%}
+\def\pgf@arrows@#1-#2\pgf@stop{%
+ \pgfsetarrowsstart{#1}%
+ \pgfsetarrowsend{#2}%
+}
+\def\pgf@arrows@test@opt[{%
+ \pgfutil@ifnextchar-{\pgf@arrows@[}%} go back to normal reading for compat. reasons.
+ \pgf@arrows@test@opt@%
+}
+\def\pgf@arrows@test@opt@#1]{%
+ \pgfutil@ifnextchar\pgf@stop{%
+ \let\pgf@arrows@options\pgf@arrows@options@scope%
+ \pgfkeys{/pgf/arrow keys/.cd,#1}%
+ \let\pgf@arrows@options@scope\pgf@arrows@options%
+ % Ok, setup the options
+ \pgfutil@gobble%
+ }{%
+ \pgf@arrows@[#1]% Oops: go back to normal mode
+ }%
}
+\let\pgf@arrows@options@scope\pgfutil@empty
+
+
+
+
-% A stealth-fighter-like pointed arrow
-%
-% Example:
%
-% \pgfsetarrows{-stealth}
+% Predefined arrows:
+%
+
+
+% A dot is used to indicate the end of the line:
+
+\pgfdeclarearrow{
+ name = .,
+ drawing code =
+}
+
+
+% An underscore adds a space as in >_> or >_ >. However, it will be
+% faster to say ">[sep] >" or ">[sep=2pt] >".
+
+\pgfdeclarearrow{
+ name = _,
+ defaults = {sep},
+ drawing code =
+}
+
+
+
+% Default shorthands:
+
+\pgfdeclarearrow{ name = To, means = } % forward declaration
+\pgfdeclarearrow{ name = Bar, means = } % forward declaration
+\pgfkeys{
+ <-> /.tip = {To},
+ >-< /.tip = {>[reversed]},
+ | /.tip = {Bar}
+}
+
+
+
+% Compatibility with old arrow system:
+
+\pgfkeys {}
+
+\def\pgf@arrows@direct@def#1#2{\expandafter\pgf@arrows@direct@def@\expandafter{\csname pgf@ar@means@#2\endcsname}{#1}}
+\def\pgf@arrows@direct@def@#1#2{\expandafter\def\csname pgf@arrows@direct@name@#2\endcsname{\pgf@arrow@handle@shorthand@empty{#1}}}
+\pgf@arrows@direct@def{start@[}{]}
+\pgf@arrows@direct@def{start@]}{[}
+\pgf@arrows@direct@def{start@spaced [}{spaced ]}
+\pgf@arrows@direct@def{start@spaced ]}{spaced [}
+\pgf@arrows@direct@def{end@[}{[}
+\pgf@arrows@direct@def{end@]}{]}
+\pgf@arrows@direct@def{end@spaced [}{spaced [}
+\pgf@arrows@direct@def{end@spaced ]}{spaced ]}
+
+\def\pgfsetarrowoptions#1#2{\expandafter\def\csname pgf@arrow@compat@opt@#1\endcsname{#2}}
+\def\pgfgetarrowoptions#1{\csname pgf@arrow@compat@opt@#1\endcsname}
+\def\pgfarrowsdeclare#1#2#3#4{%
+ \pgfdeclarearrow{ name ={#1}-{#2}, setup code ={#3}, drawing code={#4}, parameters/.expand once={\csname pgf@arrow@compat@opt@#2\endcsname}}
+ \expandafter\def\csname pgf@arrow@compat@opt@#2\endcsname{0}}
+\def\pgfarrowsleftextend#1{\pgfmathsetlength\pgf@xa{#1}\pgfarrowssetbackend{\pgf@xa}}
+\def\pgfarrowsrightextend#1{\pgfmathsetlength\pgf@xb{#1}\pgfarrowssettipend{\pgf@xb}}
+\def\pgfarrowsdeclarealias#1#2#3#4{\pgfdeclarearrow{ name ={#1}-{#2}, means ={#4} } }
+\def\pgfarrowsdeclarereversed#1#2#3#4{\pgfdeclarearrow{ name ={#1}-{#2}, means={{#4}[reversed]}}}
+\def\pgfarrowsdeclarecombine{\pgfutil@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}}
+\def\pgf@@arrowsdeclarecombine{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}}
+\def\pgf@arrowsdeclarecombine[#1]#2#3#4#5#6#7{\def\pgf@@temp{#1}\ifx\pgf@@temp\pgf@linewidthtext\def\pgf@@temp{+0pt 1}\fi%
+ \pgfdeclarearrow{name ={#2}-{#3}, means={#5[sep/.expand once=\pgf@@temp]#6}}}
+\def\pgf@linewidth@text{\pgflinewidth}
+\def\pgfarrowsdeclarecombine@star*{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}}
+\def\pgf@arrowsdeclarecombine@star[#1]#2#3#4#5#6#7{\def\pgf@@temp{#1}\ifx\pgf@@temp\pgf@linewidthtext\def\pgf@@temp{+0pt 1}\fi%
+ \pgfdeclarearrow{name ={#2}-{#3}, means={#5[sep/.expand once=\pgf@@temp].#6}}}
+\def\pgfarrowsdeclaredouble{\pgfutil@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}}
+\def\pgf@arrowsdeclaredouble[#1]#2#3#4#5{\pgfarrowsdeclarecombine[#1]{#2}{#3}{#4}{#5}{#4}{#5}}
+\def\pgfarrowsdeclaretriple{\pgfutil@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}}
+\def\pgf@arrowsdeclaretriple[#1]#2#3#4#5{ \pgfarrowsdeclarecombine[#1]{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}{#4}{#5}%
+ \pgfarrowsdeclarecombine[#1]{#2}{#3}{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}}
+\def\pgf@linewidthtext{\pgflinewidth}
\pgfarrowsdeclare{stealth}{stealth}
{
@@ -432,16 +1087,7 @@
\pgfpathlineto{\pgfqpoint{-3\pgfutil@tempdima}{-4\pgfutil@tempdima}}
\pgfusepathqfill
}
-
\pgfarrowsdeclarereversed{stealth reversed}{stealth reversed}{stealth}{stealth}
-
-
-% An arrow similar to the $\to$ arrow
-%
-% Example:
-%
-% \pgfsetarrow{-to}
-
\pgfarrowsdeclare{to}{to}
{
\pgfutil@tempdima=-0.84pt%
@@ -469,7 +1115,7 @@
{\pgfqpoint{-3\pgfutil@tempdima}{-4\pgfutil@tempdima}}
\pgfusepathqstroke
}
-
+\pgfkeys{To /.tip = to}
\pgfarrowsdeclare{to reversed}{to reversed}
{
\pgfutil@tempdima=-0.21pt%
@@ -497,15 +1143,6 @@
{\pgfqpoint{3.5\pgfutil@tempdima}{-4\pgfutil@tempdima}}
\pgfusepathqstroke
}
-
-
-
-% LaTeX's orginal arrow type
-%
-% Example:
-%
-% \pgfsetarrows{-latex}
-
\pgfarrowsdeclare{latex}{latex}
{
\pgfutil@tempdima=0.28pt%
@@ -537,16 +1174,7 @@
\pgfusepathqfill
}
\pgfarrowsdeclarereversed{latex reversed}{latex reversed}{latex}{latex}
-
-
-
-% A bar shaped arrow
-%
-% Example:
-%
-% \pgfsetarrows{-|}
-
-\pgfarrowsdeclare{|}{|}
+\pgfarrowsdeclare{@bar}{@bar}
{
\pgfarrowsleftextend{+-0.25\pgflinewidth}
\pgfarrowsrightextend{+.75\pgflinewidth}
@@ -560,17 +1188,7 @@
\pgfpathlineto{\pgfqpoint{0.25\pgflinewidth}{\pgfutil@tempdima}}
\pgfusepathqstroke
}
-
-
-% A space arrow
-%
-% This arrow can be combined with other arrows to add "space" around
-% them.
-%
-% Example:
-%
-% \pgfarrowsdeclarecombine{my<}{my>}{<}{>}{space}{space}
-
+\pgfkeys{Bar /.tip = @bar}
\pgfarrowsdeclare{space}{space}
{
\pgfutil@tempdima=0.88pt%
@@ -583,3 +1201,5 @@
\endinput
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
index d8eaca5aee7..75789f2d16c 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.17 2010/09/01 08:56:40 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.20 2013/07/15 12:05:31 tantau Exp $
@@ -107,10 +107,32 @@
\ifpgfexternal@aux@in@dpth
\csname newwrite\endcsname\w@pgfexternal@auxout
\fi
+ \pgfexternal@geometry@compatibility
\fi%
\gdef\pgfrealjobname##1{}% avoid multiple calls.
}
+\def\pgfexternal@geometry@compatibility{%
+ % check if \usepackage{geometry} is loaded:
+ \pgfutil@ifundefined{geometry}{%
+ }{%
+ % The geometry package hooks into \begin{document}, evaluates
+ % its driver -- and generates \special instructions to set the
+ % paper size.
+ %
+ % Unfortunately, this confuses dvips utterly - and perhaps
+ % other drivers as well.
+ %
+ % Thus, if we currently about to generate some external
+ % graphics, we WANT to disable geometry (it has no purpose in
+ % this context anyway).
+ %
+ % This here works well:
+ \immediate\write16{Package TikZ externalization: calling \string\geometry{driver=none} during externalization.^^J}%
+ \geometry{driver=none}%
+ }%
+}%
+
\def\pgfexternal@nofiles{%
% replace \relax. The \nofiles macros does
% \let\makeglossary=\relax
@@ -158,7 +180,7 @@
% This will be overwritten by the tikz external lib if it is loaded.
\def\pgfexternal@error@no@shipout{%
- \PackageError{pgf}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}%
+ \pgferror{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}%
}%
@@ -238,13 +260,23 @@
\endgroup
}
-% Defines \pgfexternaldepth to be the depth of the external picture
-% '#1' and \pgfexternaltrimleft / \pgfexternaltrimright to be the 'hbaseline' shift.
-%
+% Reads the .dpth file which contains meta data of the external
+% picture.
+%
+% This command handles the following stuff:
+% - it defines \pgfexternaldepth . The macro contains the contents of
+% a line which does not start with a control sequence (for example a
+% line containing '50pt')
+% - it defines \pgfexternaltrimleft and \pgfexternaltrimright
+% - it checks if the .dpth file contains content stored by means of
+% \pgfexternalstorecommand. If so, the argument of
+% \pgfexternalstorecommand will be restored.
+% - anything else will be appended to the main .aux file, assuming that
+% it contains \label or \ref information (only if the LaTeX switch
+% \if@filesw is \iftrue).
%
-% Furthermore, it handles any auxiliary information stored in the
-% .dpth file (it appends it to the main aux file).
%
+% #1: the image file name (such that #1.dpth exists)
\def\pgfexternalreaddpth#1{%
% no \begingroup. Handle that manually:
\edef\pgfexternalreaddpth@restore{%
@@ -291,6 +323,10 @@
% the .aux file.
%
\expandafter\ifx\pgf@first\pgfexternal@restore
+ % if the first line in the .dpth file starts with the
+ % magic string \pgfexternal@restore, the complete line
+ % will be executed as-is. Example:
+ % \pgfexternal@restore{\def\somevalue{1}}
#1%
\else
% do NOT execute #1! many LaTeX commands don't support it (\label for example)
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
index eeb6c3e8635..81b39f34659 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.9 2008/04/22 17:03:26 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.11 2013/09/19 22:34:34 tantau Exp $
% Globals
@@ -123,13 +123,15 @@
% \pgfsetstrokecolor{red}
\def\pgfsetstrokecolor#1{%
- \pgfutil@colorlet{pgf@tempcolor}{#1}%
- \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}%
- \expandafter\expandafter\expandafter\pgf@setstrokecolor\csname\string\color@pgf@tempcolor\endcsname%
+ \pgfutil@colorlet{pgfstrokecolor}{#1}%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgfstrokecolor}}%
+ \expandafter\expandafter\expandafter\global%
+ \expandafter\expandafter\expandafter\let\expandafter\csname\expandafter\string\expandafter\color@pgfstrokecolor\expandafter\endcsname\csname\string\color@pgfstrokecolor\endcsname%
+ \expandafter\expandafter\expandafter\pgf@setstrokecolor\csname\string\color@pgfstrokecolor\endcsname%
}
\def\pgf@setstrokecolor#1#2#3#4#5{%
\expandafter\ifx\csname pgfsys@color@#4@stroke\endcsname\relax%
- \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}%
+ \pgferror{Unsupported color model `#4'. Sorry}%
\else%
\edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4@stroke\endcsname}%
\pgf@uncomma#5,,%
@@ -155,13 +157,15 @@
% \pgfsetfillcolor{gray}
\def\pgfsetfillcolor#1{%
- \pgfutil@colorlet{pgf@tempcolor}{#1}%
- \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}%
- \expandafter\expandafter\expandafter\pgf@setfillcolor\csname\string\color@pgf@tempcolor\endcsname%
+ \pgfutil@colorlet{pgffillcolor}{#1}%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgffillcolor}}%
+ \expandafter\expandafter\expandafter\global%
+ \expandafter\expandafter\expandafter\let\expandafter\csname\expandafter\string\expandafter\color@pgffillcolor\expandafter\endcsname\csname\string\color@pgffillcolor\endcsname%
+ \expandafter\expandafter\expandafter\pgf@setfillcolor\csname\string\color@pgffillcolor\endcsname%
}
\def\pgf@setfillcolor#1#2#3#4#5{%
\expandafter\ifx\csname pgfsys@color@#4@fill\endcsname\relax%
- \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}%
+ \pgferror{Unsupported color model `#4'. Sorry}%
\else%
\edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4@fill\endcsname}%
\pgf@uncomma#5,,%
@@ -177,13 +181,17 @@
% \pgfsetcolor{blue}
\def\pgfsetcolor#1{%
- \pgfutil@colorlet{pgf@tempcolor}{#1}%
- \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}%
- \expandafter\expandafter\expandafter\pgf@setcolor\csname\string\color@pgf@tempcolor\endcsname%
+ \pgfutil@colorlet{pgfstrokecolor}{#1}%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgfstrokecolor}}%
+ \expandafter\expandafter\expandafter\global%
+ \expandafter\expandafter\expandafter\let\expandafter\csname\expandafter\string\expandafter\color@pgfstrokecolor\expandafter\endcsname\csname\string\color@pgfstrokecolor\endcsname%
+ \expandafter\expandafter\expandafter\global%
+ \expandafter\expandafter\expandafter\let\expandafter\csname\expandafter\string\expandafter\color@pgffillcolor\expandafter\endcsname\csname\string\color@pgfstrokecolor\endcsname%
+ \expandafter\expandafter\expandafter\pgf@setcolor\csname\string\color@pgfstrokecolor\endcsname%
}
\def\pgf@setcolor#1#2#3#4#5{%
\expandafter\ifx\csname pgfsys@color@#4\endcsname\relax%
- \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}%
+ \pgferror{Unsupported color model `#4'. Sorry}%
\else%
\edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4\endcsname}%
\pgf@uncomma#5,,%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
index 59a3699f70d..1f2d6ea5d17 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.16 2010/03/25 20:57:13 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.18 2013/07/15 15:41:24 tantau Exp $
@@ -44,8 +44,8 @@
\pgfkeys{/pgf/images/page=}% make page empty
\fi%
\ifx\pgf@filename\pgfutil@empty%
- \PackageWarning{pgf}%
- {File "#3" not found when defining image "#2".\MessageBreak
+ \pgfwarning%
+ {File "#3" not found when defining image "#2".
Tried all extensions in "\pgfsys@imagesuffixlist"}%
\pgf@declaredraftimage{#2}{#3}%
\else%
@@ -66,13 +66,14 @@
\pgfkeys{/pgf/images/height/.estore in=\pgf@imageheight}
\pgfkeys{/pgf/images/page/.estore in=\pgf@imagepage}
\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{#1},.default=true}
+\let\pgf@imageinterpolate\pgfutil@empty
\pgfkeys{/pgf/images/mask/.code=%
{%
\edef\pgf@imagemask{#1}%
\ifx\pgf@imagemask\pgfutil@empty%
\else%
\pgfutil@ifundefined{pgf@mask@#1}%
- {\PackageError{pgf}{Undefined mask "#1".}{}%
+ {\pgferror{Undefined mask "#1".}%
\edef\pgf@imagemask{}}%
{\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}%
}%
@@ -92,11 +93,11 @@
% #2: file name
\def\pgf@declaredraftimage#1#2{%
\ifx\pgf@imagewidth\pgfutil@empty%
- \PackageWarning{pgf}{Missing width for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}%
+ \pgfwarning{Missing width for image "#1" ("#2") in draft mode. Using 1cm instead}%
\edef\pgf@imagewidth{1cm}%
\fi%
\ifx\pgf@imageheight\pgfutil@empty%
- \PackageWarning{pgf}{Missing height for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}%
+ \pgfwarning{Missing height for image "#1" ("#2") in draft mode. Using 1cm instead}%
\edef\pgf@imageheight{1cm}%
\fi%
\ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi%
@@ -105,7 +106,7 @@
\vrule\kern-0.4pt%
\vbox to \pgf@imageheight{%
\hrule\vfil%
- \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\tiny#2\pgf@imagepage\hfil\hskip-10cm}%
+ \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\pgfutil@font@tiny#2\pgf@imagepage\hfil\hskip-10cm}%
\vfil\hrule}%
\kern-0.4pt\vrule}%
}%
@@ -141,8 +142,8 @@
\gdef\pgf@filename{}%
\expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}%
\ifx\pgf@filename\pgfutil@empty%
- \PackageWarning{pgf}%
- {File "#3" not found when defining mask "#2".\MessageBreak
+ \pgfwarning%
+ {File "#3" not found when defining mask "#2".
Tried all extensions in "\pgfsys@imagesuffixlist"}%
\else%
\pgfsys@definemask{#2}%
@@ -183,7 +184,7 @@
\def\pgf@imagename{pgf@image@#1}%
\pgf@tryextensions{\pgf@imagename}{\pgfalternateextension}%
\expandafter\pgfutil@ifundefined\expandafter{\pgf@imagename}%
- {\PackageError{pgf}{Undefined image "#1"}{}}%
+ {\pgferror{Undefined image "#1"}}%
{{\leavevmode\csname\pgf@imagename\endcsname}}}
\def\pgf@tryextensions#1#2{%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
index e18aea0cde9..880b41c4a30 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.2 2010/08/27 12:51:47 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.7 2013/07/18 17:07:38 tantau Exp $
% Creates a new pgf layer
@@ -21,8 +21,10 @@
% \pgfdeclarelayer{background}
\def\pgfdeclarelayer#1{%
- \expandafter\pgf@newbox\csname pgf@layerbox@#1\endcsname%
- \expandafter\pgf@newbox\csname pgf@layerboxsaved@#1\endcsname%
+ \pgfutil@ifundefined{pgf@layerbox@#1}{%
+ \expandafter\expandafter\csname pgf@newbox\endcsname\csname pgf@layerbox@#1\endcsname%
+ \expandafter\expandafter\csname pgf@newbox\endcsname\csname pgf@layerboxsaved@#1\endcsname%
+ }{}%
}
\let\pgf@newbox=\newbox % avoid plain TeX outer problem
@@ -35,6 +37,9 @@
% Sets the list of layers that make up the picture. The layers will be
% put on top of each other in the order given.
%
+% This command can also be given inside of a picture in which case it
+% applies only to that very picture.
+%
% Example:
%
% \pgfsetlayers{background,main}
@@ -42,8 +47,6 @@
\def\pgfsetlayers#1{\edef\pgf@layerlist{#1}}
\pgfsetlayers{main}
-
-
% Adds code to a layer
%
% #1 = layer name
@@ -58,30 +61,80 @@
% \fill[red] (0,0) -- (1,1);
% \end{pgfonlayer}
+\def\pgfonlayer@name{main}
+
\def\pgfonlayer#1{%
\pgfutil@ifundefined{pgf@layerbox@#1}{%
- \PackageError{pgf}{Sorry, the requested layer '#1' could not be found. Maybe you misspelled it?}{}%
- \bgroup
- \begingroup
+ \pgferror{Sorry, the requested layer '#1' could not be found. Maybe you misspelled it?}%
+ \bgroup
+ \begingroup
}{%
- \expandafter\global\expandafter%
- \setbox\csname pgf@layerbox@#1\endcsname=\hbox to 0pt%
- \bgroup%
- \expandafter\box\csname pgf@layerbox@#1\endcsname%
- \begingroup%
+ \begingroup
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfonlayer@name
+ % we are already on this layer.
+ \def\pgf@temp{%
+ \bgroup
+ \begingroup
+ }%
+ \else
+ \let\pgfonlayer@name=\pgf@temp
+ \pgfonlayer@assert@is@active
+ \def\pgf@temp{%
+ \expandafter\global\expandafter%
+ \setbox\csname pgf@layerbox@#1\endcsname=\hbox to 0pt%
+ \bgroup%
+ \expandafter\box\csname pgf@layerbox@#1\endcsname%
+ \begingroup%
+ }%
+ \fi
+ \pgfsetlinewidth{0.4pt}% always reset the line width
+ \pgf@temp
}%
}
\def\endpgfonlayer{%
\endgroup%
\hss
\egroup%
+ \endgroup
}
\let\startpgfonlayer=\pgfonlayer
\let\stoppgfonlayer=\endpgfonlayer
-
-
+\def\pgfdiscardlayername{discard}
+
+\def\pgfonlayer@assert@is@active{%
+ \ifx\pgfonlayer@name\pgfdiscardlayername
+ % this special layer name can be used as /dev/null without
+ % warning.
+ \else
+ \begingroup
+ \def\pgfonlayer@isactive{0}%
+ \expandafter\pgf@assert@layer@is@active@loop\pgf@layerlist,,\relax%
+ \if0\pgfonlayer@isactive
+ \pgfonlayer@assert@fail
+ \fi
+ \endgroup
+ \fi
+}%
+\def\pgfonlayer@assert@fail{%
+ \pgferror{Sorry, the requested layer '\pgfonlayer@name' is not
+ part of the layer list. Please verify that you provided
+ \string\pgfsetlayers\space and that '\pgfonlayer@name' is part of this list}%
+}%
+\def\pgf@assert@layer@is@active@loop#1,#2,\relax{%
+ \edef\pgf@test{#1}%
+ \ifx\pgf@test\pgfonlayer@name
+ \def\pgfonlayer@isactive{1}%
+ \else
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@assert@layer@is@active@loop#2,\relax%
+ \fi%
+ \fi
+}
% Hooks into the scoping:
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
index db62f73b6bf..60cede3f006 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.24 2010/08/03 12:27:36 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.29 2013/10/07 15:51:46 tantau Exp $
\newdimen\pgf@path@lastx
@@ -16,6 +16,8 @@
\let\pgfgetpath=\pgfsyssoftpath@getcurrentpath
\let\pgfsetpath=\pgfsyssoftpath@setcurrentpath
+
+
% Replace corners by arcs.
%
% #1 = in-size of arc
@@ -75,6 +77,36 @@
}
+
+% The following protocol the passed sizes and all the corresponding
+% softpath commands. The nonlinear transformation (nlt) module
+% overwrites these commands.
+
+\def\pgf@lt@moveto#1#2{%
+ \pgf@protocolsizes{#1}{#2}%
+ \pgfsyssoftpath@moveto{\the#1}{\the#2}%
+}
+\def\pgf@lt@lineto#1#2{%
+ \pgf@protocolsizes{#1}{#2}%
+ \pgfsyssoftpath@lineto{\the#1}{\the#2}%
+}
+\def\pgf@lt@curveto#1#2#3#4#5#6{%
+ \pgf@protocolsizes{#1}{#2}%
+ \pgf@protocolsizes{#3}{#4}%
+ \pgf@protocolsizes{#5}{#6}%
+ \pgfsyssoftpath@curveto{\the#1}{\the#2}{\the#3}{\the#4}{\the#5}{\the#6}%
+}
+
+\let\pgf@lt@closepath\pgfsyssoftpath@closepath
+
+\let\pgf@nlt@moveto\pgf@lt@moveto
+\let\pgf@nlt@lineto\pgf@lt@lineto
+\let\pgf@nlt@curveto\pgf@lt@curveto
+\let\pgf@nlt@closepath\pgf@lt@closepath
+
+\let\pgf@nlt@list\pgfutil@empty % If non-empty, the nlt module is active
+
+
% Move current point to #1.
%
% #1 = new current point
@@ -87,8 +119,7 @@
\def\pgfpathmoveto#1{%
\pgfpointtransformed{#1}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgfsyssoftpath@moveto{\the\pgf@x}{\the\pgf@y}%
+ \pgf@nlt@moveto{\pgf@x}{\pgf@y}%
\global\pgf@path@lastx=\pgf@x%
\global\pgf@path@lasty=\pgf@y%
}
@@ -147,9 +178,8 @@
\def\pgfpathlineto#1{%
\pgfpointtransformed{#1}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
\pgf@roundcornerifneeded%
- \pgfsyssoftpath@lineto{\the\pgf@x}{\the\pgf@y}%
+ \pgf@nlt@lineto{\pgf@x}{\pgf@y}%
\global\pgf@path@lastx=\pgf@x%
\global\pgf@path@lasty=\pgf@y%
}
@@ -173,7 +203,7 @@
\def\pgfpathclose{%
\pgf@roundcornerifneeded%
- \pgfsyssoftpath@closepath%
+ \pgf@nlt@closepath%
}
@@ -192,17 +222,14 @@
\def\pgfpathcurveto#1#2#3{%
\pgfpointtransformed{#3}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
\pgfpointtransformed{#2}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgfpointtransformed{#1}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
\pgf@roundcornerifneeded%
- \pgfsyssoftpath@curveto{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}%
+ \pgf@nlt@curveto{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}{\pgf@xb}{\pgf@yb}%
\global\pgf@path@lastx=\pgf@xb%
\global\pgf@path@lasty=\pgf@yb%
}
@@ -223,7 +250,6 @@
\def\pgfpathquadraticcurveto#1#2{%
\pgfpointtransformed{#2}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
\pgfpointtransformed{#1}%
@@ -234,13 +260,11 @@
\pgf@ya=.33333333\pgf@yb%
\advance\pgf@xa by\pgf@xc%
\advance\pgf@ya by\pgf@yc%
- \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
% compute first control point
\advance\pgf@xc by.3333333\pgf@path@lastx%
\advance\pgf@yc by.3333333\pgf@path@lasty%
- \pgf@protocolsizes{\pgf@xc}{\pgf@yc}%
\pgf@roundcornerifneeded%
- \pgfsyssoftpath@curveto{\the\pgf@xc}{\the\pgf@yc}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}%
+ \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@xa}{\pgf@ya}{\pgf@xb}{\pgf@yb}%
\global\pgf@path@lastx=\pgf@xb%
\global\pgf@path@lasty=\pgf@yb%
}
@@ -374,12 +398,9 @@
\pgf@yc=\pgf@yb\relax%
\advance \pgf@xc by \pgf@x\relax%
\advance \pgf@yc by \pgf@y\relax%
- \pgfsyssoftpath@curveto{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xc}{\the\pgf@yc}{\the\pgf@xb}{\the\pgf@yb}%
+ \pgf@nlt@curveto{\pgf@xa}{\pgf@ya}{\pgf@xc}{\pgf@yc}{\pgf@xb}{\pgf@yb}%
\global\pgf@path@lastx=\pgf@xb%
\global\pgf@path@lasty=\pgf@yb%
- \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
- \pgf@protocolsizes{\pgf@xb}{\pgf@yb}%
- \pgf@protocolsizes{\pgf@xc}{\pgf@yc}%
}%
}
@@ -819,7 +840,7 @@
\pgfpatharcofellipse@{%
\pgfpoint
{\pgfpath@center@x + #5*cos(\pgfpath@angle@i)}
- {\pgfpath@center@y + #6*sin(\pgfpath@angle@i)}
+ {\pgfpath@center@y + #6*sin(\pgfpath@angle@i)}%
}%
%
\advance\c@pgf@countd by1
@@ -900,8 +921,7 @@
{%
\advance\pgf@xa by\pgf@xc%
\advance\pgf@ya by\pgf@yc%
- \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}%
- \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
+ \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
}%
\pgf@x=0.55228475\pgf@xb% first arc
\pgf@y=0.55228475\pgf@yb%
@@ -909,8 +929,7 @@
\advance\pgf@y by\pgf@ya%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
- \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
\pgf@x=0.55228475\pgf@xa%
\pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
@@ -919,10 +938,9 @@
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\advance\pgf@xb by\pgf@xc%
- \advance\pgf@yb by\pgf@yc%
- \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xb}{\the\pgf@yb}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@xb}{\pgf@yb}%
+ \advance\pgf@yb by\pgf@yc%
+ \pgf@temp%
+ \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@yb}%
}%
\pgf@xa=-\pgf@xa% flip first axis
\pgf@ya=-\pgf@ya%
@@ -932,8 +950,7 @@
\advance\pgf@y by\pgf@yb%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
- \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
\pgf@x=0.55228475\pgf@xb%
\pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
@@ -942,10 +959,9 @@
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\advance\pgf@xa by\pgf@xc%
- \advance\pgf@ya by\pgf@yc%
- \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
+ \advance\pgf@ya by\pgf@yc%
+ \pgf@temp%
+ \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}%
}%
\pgf@xb=-\pgf@xb% flip second axis
\pgf@yb=-\pgf@yb%
@@ -955,8 +971,7 @@
\advance\pgf@y by\pgf@ya%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
- \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
\pgf@x=0.55228475\pgf@xa%
\pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
@@ -966,9 +981,8 @@
\advance\pgf@y by\pgf@yc%
\advance\pgf@xb by\pgf@xc%
\advance\pgf@yb by\pgf@yc%
- \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xb}{\the\pgf@yb}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@xb}{\pgf@yb}%
+ \pgf@temp%
+ \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@yb}%
}%
\pgf@xa=-\pgf@xa% flip first axis once more
\pgf@ya=-\pgf@ya%
@@ -978,8 +992,7 @@
\advance\pgf@y by\pgf@yb%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
- \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
\pgf@x=0.55228475\pgf@xb%
\pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
@@ -989,12 +1002,11 @@
\advance\pgf@y by\pgf@yc%
\advance\pgf@xa by\pgf@xc%
\advance\pgf@ya by\pgf@yc%
- \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
+ \pgf@temp%
+ \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}%
}%
- \pgfsyssoftpath@closepath%
- \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}%
+ \pgf@nlt@closepath%
+ \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
}
@@ -1029,7 +1041,9 @@
\ifpgf@pt@identity%
\ifpgf@arccorners%
\else%
- \let\pgfrect@next=\pgf@normalrect%
+ \ifx\pgf@nlt@list\pgfutil@empty%
+ \let\pgfrect@next=\pgf@normalrect%
+ \fi%
\fi%
\fi%
\pgfrect@next%
@@ -1087,8 +1101,8 @@
% Append a grid to the current path.
%
-% #1 = lower left point of grid
-% #2 = upper right point of grid
+% #1 = first corner point of grid
+% #2 = second corner point of grid
%
% Options:
%
@@ -1119,97 +1133,86 @@
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
\pgf@process{#2}%
- \pgf@xa=\pgf@x\relax%
- \pgf@ya=\pgf@y\relax%
- {%
- % compute bounding box
- % first corner
- \pgf@x=\pgf@xb%
- \pgf@y=\pgf@yb%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- % second corner
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ % Swap coordinates if one of them is smaller than the other:
+ \ifdim\pgf@xa>\pgf@xb%
\pgf@x=\pgf@xb%
- \pgf@y=\pgf@ya%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- % third corner
- \pgf@x=\pgf@xa%
+ \pgf@xb=\pgf@xa%
+ \pgf@xa=\pgf@x%
+ \fi%
+ \ifdim\pgf@ya>\pgf@yb%
\pgf@y=\pgf@yb%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- % fourth corner
- \pgf@x=\pgf@xa%
- \pgf@y=\pgf@ya%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
- \pgf@protocolsizes{\pgf@x}{\pgf@y}%
- }%
- \c@pgf@counta=\pgf@y\relax%
+ \pgf@yb=\pgf@ya%
+ \pgf@ya=\pgf@y%
+ \fi%
+ \c@pgf@counta=\pgf@ya\relax%
\c@pgf@countb=\pgf@yc\relax%
\divide\c@pgf@counta by\c@pgf@countb\relax%
- \pgf@y=\c@pgf@counta\pgf@yc\relax%
- \ifdim\pgf@y<\pgf@ya%
- \advance\pgf@y by\pgf@yc%
+ \pgfutil@tempdima=\c@pgf@counta\pgf@yc\relax%
+ \ifdim\pgfutil@tempdima<\pgf@ya%
+ \advance\pgfutil@tempdima by\pgf@yc%
\fi%
- \loop% horizontal lines
+ \pgfutil@tempdimb\pgf@x
+ \pgfutil@loop% horizontal lines
{%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
+ \pgf@xa=\pgfutil@tempdimb%
+ \pgf@ya=\pgfutil@tempdima%
\pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}%
+ \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
\pgf@xa=\pgf@xb%
- \pgf@ya=\pgf@y%
+ \pgf@ya=\pgfutil@tempdima%
\pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgfsyssoftpath@lineto{\the\pgf@xa}{\the\pgf@ya}%
+ \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
}%
- \advance\pgf@y by\pgf@yc%
- \ifdim\pgf@y<\pgf@yb%
- \repeat%
- \advance\pgf@y by-0.01pt\relax%
- \ifdim\pgf@y<\pgf@yb%
+ \advance\pgfutil@tempdima by\pgf@yc%
+ \ifdim\pgfutil@tempdima<\pgf@yb%
+ \pgfutil@repeat%
+ \advance\pgfutil@tempdima by-0.01pt\relax%
+ \ifdim\pgfutil@tempdima<\pgf@yb%
{%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
+ \pgf@xa=\pgfutil@tempdimb%
+ \pgf@ya=\pgfutil@tempdima%
\pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}%
+ \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
\pgf@xa=\pgf@xb%
- \pgf@ya=\pgf@y%
+ \pgf@ya=\pgfutil@tempdima%
\pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgfsyssoftpath@lineto{\the\pgf@xa}{\the\pgf@ya}%
+ \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
}%
\fi%
- \c@pgf@counta=\pgf@x\relax%
+ \c@pgf@counta=\pgfutil@tempdimb\relax%
\c@pgf@countb=\pgf@xc\relax%
\divide\c@pgf@counta by\c@pgf@countb\relax%
- \pgf@x=\c@pgf@counta\pgf@xc\relax%
- \ifdim\pgf@x<\pgf@xa%
- \advance\pgf@x by\pgf@xc%
+ \pgfutil@tempdimb=\c@pgf@counta\pgf@xc\relax%
+ \ifdim\pgfutil@tempdimb<\pgf@xa%
+ \advance\pgfutil@tempdimb by\pgf@xc%
\fi%
- \loop% vertical lines
+ \pgfutil@loop% vertical lines
{%
- \pgf@xc=\pgf@x%
+ \pgf@xc=\pgfutil@tempdimb%
\pgf@yc=\pgf@ya%
\pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}%
- \pgf@xc=\pgf@x%
+ \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
+ \pgf@xc=\pgfutil@tempdimb%
\pgf@yc=\pgf@yb%
\pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgfsyssoftpath@lineto{\the\pgf@xc}{\the\pgf@yc}%
+ \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
}%
- \advance\pgf@x by\pgf@xc%
- \ifdim\pgf@x<\pgf@xb%
- \repeat%
- \advance\pgf@x by-0.01pt\relax%
- \ifdim\pgf@x<\pgf@xb%
+ \advance\pgfutil@tempdimb by\pgf@xc%
+ \ifdim\pgfutil@tempdimb<\pgf@xb%
+ \pgfutil@repeat%
+ \advance\pgfutil@tempdimb by-0.01pt\relax%
+ \ifdim\pgfutil@tempdimb<\pgf@xb%
{%
- \pgf@xc=\pgf@x%
+ \pgf@xc=\pgfutil@tempdimb%
\pgf@yc=\pgf@ya%
\pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}%
- \pgf@xc=\pgf@x%
+ \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
+ \pgf@xc=\pgfutil@tempdimb%
\pgf@yc=\pgf@yb%
\pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgfsyssoftpath@lineto{\the\pgf@xc}{\the\pgf@yc}%
+ \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
}%
\fi%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
index 9bcfc739f56..b9c47231afa 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
@@ -7,9 +7,107 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.8 2008/10/09 16:46:56 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.9 2013/09/09 10:05:41 tantau Exp $
+% Split a path at the last subpath of a path
+%
+% #1 = a macro that stores a path
+%
+% Description:
+%
+% This command will split the path into two parts:
+%
+% \pgfprocessresultpathprefix
+% The part of the path before the last subpath.
+%
+% \pgfprocessresultpathsuffix
+% The last subpath on the path.
+%
+% #1 will always be equal to the contents of the two above macros
+% concatenated. Normally, your objective will be to modify the
+% \pgfprocessresultpathsuffix and then concatenate the result.
+
+\def\pgfprocesssplitpath#1{%
+ \let\pgfprocessresultpathprefix\pgfutil@empty%
+ \let\pgfprocessresultpathsuffix\pgfutil@empty%
+ \let\pgf@next\pgf@process@split%
+ \expandafter\pgf@process@split#1\pgfsyssoftpath@movetotoken{}{}\pgf@stop%
+}
+
+\def\pgf@process@split#1\pgfsyssoftpath@movetotoken#2#3#4{%
+ \ifx#4\pgf@stop% ok, end reached!
+ \expandafter\def\expandafter\pgfprocessresultpathsuffix\expandafter{\pgfprocessresultpathsuffix#1}%
+ \let\pgf@next\pgfutil@gobble%
+ \else%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgfprocessresultpathprefix%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultpathprefix\pgfprocessresultpathsuffix#1}%
+ \def\pgfprocessresultpathsuffix{\pgfsyssoftpath@movetotoken{#2}{#3}}%
+ \fi%
+ \pgf@next#4%
+}
+
+
+
+% Split a subpath at the end
+%
+% #1 = a macro that stores an open subpath that contains at least two
+% path commands (so, not just a moveto);
+%
+% Description:
+%
+% Splits the supath into two parts:
+%
+% \pgfprocessresultsubpathsuffix
+% This macro contains the last two "relevant" path commands: The end
+% of the path command that led to the last path command and this
+% last path command. In essence, this macro contains everything you
+% "need to modify" if you wish to modify the end of the path.
+%
+% \pgfprocessresultsubpathprefix
+% Everything before the previous macro on the subpath.
+
+\def\pgfprocesssplitsubpath#1{%
+ % First, we need to find the end:
+ \let\pgf@tempa\pgfutil@emtpy%
+ \let\pgf@tempb\pgfutil@emtpy%
+ \let\pgf@tempc\pgfutil@emtpy%
+ \let\pgf@tempd\pgfutil@emtpy%
+ \let\pgfprocessresultsubpathprefix\pgfutil@empty%
+ \let\pgfprocessresultsubpathsuffix\pgfutil@empty%
+ \let\pgf@next\pgf@split@subpath%
+ \expandafter\pgf@split@subpath#1\pgf@stop%
+}
+
+\newif\ifpgf@split@move
+
+\def\pgf@split@subpath#1#2#3#4{%
+ \ifx#4\pgf@stop%
+ \expandafter\def\expandafter\pgfprocessresultsubpathsuffix\expandafter{\pgfprocessresultsubpathsuffix#1{#2}{#3}}%
+ \let\pgf@next\pgfutil@gobble%
+ \else%
+ \pgf@split@movetrue%
+ \ifx#1\pgfsyssoftpath@curvetosupportatoken%
+ \pgf@split@movefalse%
+ \else
+ \ifx#1\pgfsyssoftpath@curvetosupportbtoken%
+ \pgf@split@movefalse%
+ \fi%
+ \fi%
+ \ifpgf@split@move%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgfprocessresultsubpathprefix%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\pgfprocessresultsubpathprefix\pgfprocessresultsubpathsuffix}%
+ \def\pgfprocessresultsubpathsuffix{#1{#2}{#3}}%
+ \else%
+ \expandafter\def\expandafter\pgfprocessresultsubpathsuffix\expandafter{\pgfprocessresultsubpathsuffix#1{#2}{#3}}%
+ \fi%
+ \fi%
+ \pgf@next#4%
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
index b803cce9caf..e60f66cce2f 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.12 2008/04/22 17:03:26 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.23 2013/12/13 15:11:58 tantau Exp $
% Stroke/fill/clip/etc. the current path. Depending on the options,
@@ -16,9 +16,9 @@
% of them are performed (in a sensible order).
%
% #1 = action(s) to be applied to the current path. Valid actions are:
-% stroke - strokes the path. If no options are given, this is the
-% default.
-% draw - same as stroke.
+% stroke - strokes the path.
+% draw - strokes the path and adds arrow tips.
+% tips - adds arrow tips.
% fill - fills the path.
% clip - clip the path.
% discard - Discards the path. Same effect as having an empty
@@ -33,27 +33,73 @@
% \pgfusepath{stroke}
\pgfkeys{
- /pgf/stroke/.code=\def\pgf@up@stroke{stroke},
- /pgf/draw/.code=\def\pgf@up@stroke{stroke},
- /pgf/fill/.code=\def\pgf@up@fill{fill},
- /pgf/clip/.code=\def\pgf@up@clip{clip},
+ /pgf/stroke/.code=\let\pgf@up@stroke\pgf@up@stroke@text\pgf@up@path@neededtrue,
+ /pgf/draw/.code=\let\pgf@up@stroke\pgf@up@stroke@text\pgf@up@path@neededtrue,
+ /pgf/fill/.code=\let\pgf@up@fill\pgf@up@fill@text\pgf@up@path@neededtrue,
+ /pgf/clip/.code=\let\pgf@up@clip\pgf@up@clip@text\pgf@up@path@neededtrue,
/pgf/discard/.code=,
- /pgf/use as bounding box/.code=\def\pgf@up@bb{\pgf@relevantforpicturesizefalse}
+ /pgf/use as bounding box/.code=\let\pgf@up@bb\pgf@do@up@bb,
+ /pgf/arrow keys/flex/.code=\pgferror{You need to say \string\usetikzlibrary{bending} for flexing and bending arrows},
+ /pgf/arrow keys/flex'/.code=\pgferror{You need to say \string\usetikzlibrary{bending} for flexing and bending arrows},
+ /pgf/arrow keys/bend/.code=\pgferror{You need to say \string\usetikzlibrary{bending} for flexing and bending arrows},
+ /pgf/arrow keys/quick/.code=\pgfarrowsaddtooptions{\let\pgf@arrow@flex@mode\pgf@arrow@mode@is@quick},
}
+\pgfkeys{
+ /pgf/.cd,
+ tips/.is choice,
+ tips/.default=true,
+ tips/proper/.code=\let\pgf@tips@mode\pgf@tips@mode@onproper,
+ tips/on proper draw/.code=\let\pgf@tips@mode\pgf@tips@mode@onproperdraw,
+ tips/true/.code=\let\pgf@tips@mode\pgf@tips@mode@true,
+ tips/on draw/.code=\let\pgf@tips@mode\pgf@tips@mode@ondraw,
+ tips/never/.code=\let\pgf@tips@mode\pgf@tips@mode@false,
+ tips/false/.code=\let\pgf@tips@mode\pgf@tips@mode@false,
+}
+\def\pgf@tips@mode@onproper{4}
+\def\pgf@tips@mode@onproperdraw{3}
+\def\pgf@tips@mode@true{2}
+\def\pgf@tips@mode@ondraw{1}
+\def\pgf@tips@mode@false{0}
+\let\pgf@tips@mode\pgf@tips@mode@ondraw
+
+
+% The following can only be set to "true" using the options in the
+% module "bending"
+\newif\ifpgf@precise@shortening
+\def\pgf@arrow@mode@is@quick{0}
+\let\pgf@arrow@flex@mode\pgf@arrow@mode@is@quick
+
+\newif\ifpgf@up@path@needed
+\newif\ifpgf@up@draw@arrows
+\def\pgf@up@stroke@text{stroke}
+\def\pgf@up@fill@text{fill}
+\def\pgf@up@clip@text{clip}
+\def\pgf@do@up@bb{\pgf@relevantforpicturesizefalse}
+
\def\pgfusepath#1{%
+ \pgf@up@path@neededfalse%
+ \pgf@up@draw@arrowsfalse%
\let\pgf@up@stroke\pgfutil@empty%
\let\pgf@up@fill\pgfutil@empty%
\let\pgf@up@clip\pgfutil@empty%
- \let\pgf@up@discard\pgfutil@empty%
\let\pgf@up@bb\pgfutil@empty%
\pgfset{#1}%
\expandafter\def\expandafter\pgf@up@action\expandafter{\csname pgfsys@\pgf@up@fill\pgf@up@stroke\endcsname}%
+ \ifnum\pgf@tips@mode=2\relax%
+ \pgf@up@path@neededtrue%
+ \fi%
+ \ifnum\pgf@tips@mode=4\relax%
+ \pgf@up@path@neededtrue%
+ \fi%
+ \ifpgf@up@path@needed%
+ \else%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ \fi%
\ifx\pgf@up@stroke\pgfutil@empty%
\ifx\pgf@up@fill\pgfutil@empty%
+ \let\pgf@up@action=\pgfutil@empty%
\ifx\pgf@up@clip\pgfutil@empty%
- \let\pgf@up@action=\pgfutil@empty%
- \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
\else%
% only clipping
\let\pgf@up@action=\pgfsys@discardpath%
@@ -86,29 +132,38 @@
%
\ifx\pgf@up@clip\pgfutil@empty%
\ifx\pgf@up@stroke\pgfutil@empty%
- \pgfsyssoftpath@invokecurrentpath%
- \pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
- \pgf@up@action%
- \else%
- \pgf@check@for@arrows%
- \ifpgf@drawarrows%
- \pgf@shorten@path@as@needed%
- \pgfsyssoftpath@invokecurrentpath%
- \pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
- \pgf@up@action%
- \pgf@stroke@inner@line@if@needed%
- \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
- \pgf@add@arrows@as@needed%
- \else%
+ \ifx\pgf@up@action\pgfutil@empty%
+ \ifnum\pgf@tips@mode=2\relax%
+ \pgf@up@draw@arrows@only%
+ \fi%
+ \ifnum\pgf@tips@mode=4\relax%
+ \pgf@up@draw@arrows@only%
+ \fi%
+ \else%
\pgfsyssoftpath@invokecurrentpath%
- \pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
\pgf@up@action%
- \pgf@stroke@inner@line@if@needed%
+ \fi%
+ \else%
+ \pgfgetpath\pgf@arrowpath%
+ \pgf@path@setup@tempswa%
+ \pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
+ \pgf@path@check@proper%
+ \ifpgfutil@tempswa%
+ \pgf@prepare@end@of@path%
+ \begingroup%
+ \pgf@prepare@start@of@path%
+ \fi%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgf@up@action%
+ \pgf@stroke@inner@line@if@needed%
+ \ifpgfutil@tempswa%
+ \pgf@add@arrow@at@start%
+ \endgroup%
+ \pgf@add@arrow@at@end%
\fi%
\fi%
\else%
\pgfsyssoftpath@invokecurrentpath%
- \pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
\pgfsys@clipnext%
\pgf@up@action%
\pgf@relevantforpicturesizefalse%
@@ -118,9 +173,70 @@
\pgf@resetpathsizes%
\ignorespaces%
}
+\def\pgf@path@setup@tempswa{%
+ \ifnum\pgf@tips@mode>0\relax
+ \pgfutil@tempswatrue%
+ \else
+ \pgfutil@tempswafalse%
+ \fi%
+}
+\def\pgf@up@draw@arrows@only{%
+ \pgfgetpath\pgf@arrowpath%
+ \pgfutil@tempswatrue%
+ \pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
+ \pgf@path@check@proper%
+ \ifpgfutil@tempswa%
+ \pgf@prepare@end@of@path%
+ \begingroup%
+ \pgf@prepare@start@of@path%
+ \pgf@add@arrow@at@start%
+ \endgroup%
+ \pgf@add@arrow@at@end%
+ \fi%
+}
+
+\def\pgf@path@check@proper{%
+ \ifpgfutil@tempswa%
+ \ifnum\pgf@tips@mode>2\relax%
+ \pgf@path@check@proper@%
+ \fi%
+ \fi%
+}
+
+
+\def\pgf@path@check@proper@{%
+ {%
+ \pgf@x0pt\pgf@y\pgf@x%
+ \pgfutil@tempswatrue%
+ \let\pgfsyssoftpath@movetotoken\pgf@path@proper@init%
+ \let\pgfsyssoftpath@linetotoken\pgf@path@proper@test%%
+ \let\pgfsyssoftpath@curvetosupportatoken\pgf@path@proper@test%
+ \let\pgfsyssoftpath@curvetosupportbtoken=\pgf@path@proper@test%
+ \let\pgfsyssoftpath@curvetotoken\pgf@path@proper@test%
+ \let\pgfsyssoftpath@rectcornertoken\pgf@path@proper@test%
+ \let\pgfsyssoftpath@rectsizetoken\pgf@path@proper@zero@test%
+ \let\pgfsyssoftpath@closepathtoken\pgf@path@proper@test%
+ % Execute the path:
+ \pgf@arrowpath%
+ \expandafter
+ }%
+ \ifpgfutil@tempswa\pgfutil@tempswafalse\else\pgfutil@tempswatrue\fi%
+}
+
+\def\pgf@path@proper@init#1#2{\pgfutil@tempswatrue\pgf@x#1\pgf@y#2}%
+\def\pgf@path@proper@test#1#2{%
+ \ifdim\pgf@x=#1\relax\else\pgfutil@tempswafalse\fi%
+ \ifdim\pgf@y=#2\relax\else\pgfutil@tempswafalse\fi}
+\def\pgf@path@proper@zero@test#1#2{%
+ \ifdim\pgf@x=0pt\relax\else\pgfutil@tempswafalse\fi%
+ \ifdim\pgf@y=0pt\relax\else\pgfutil@tempswafalse\fi}
+
+
+
\def\pgf@stroke@inner@line@if@needed{%
\ifdim\pgfinnerlinewidth>0pt\relax%
+ \expandafter\let\expandafter\pgf@temp@save\csname\string\color@pgfstrokecolor\endcsname%
\pgfsys@beginscope%
{%
\pgfsys@setlinewidth{\pgfinnerlinewidth}%
@@ -129,9 +245,17 @@
\pgfsys@stroke%
}%
\pgfsys@endscope%
+ \expandafter\global\expandafter\let\csname\string\color@pgfstrokecolor\endcsname\pgf@temp@save%
\fi%
}
+\let\pgf@prepare@start@of@path\relax%
+\let\pgf@add@arrow@at@end\relax%
+\let\pgf@add@arrow@at@start\relax%
+
+
+
+
% Shorten start/end of paths by a certain amount.
%
% #1 = amount by which paths should be shortened.
@@ -149,94 +273,374 @@
\def\pgfsetshortenstart#1{\pgfmathsetlength\pgf@shorten@start@additional{#1}}
\def\pgfsetshortenend#1{\pgfmathsetlength\pgf@shorten@end@additional{#1}}
-\newif\ifpgf@drawarrows
-
-\def\pgf@check@for@arrows{%
- \pgf@drawarrowsfalse%
- \ifx\pgf@startarrow\pgfutil@empty\else\pgf@drawarrowstrue\fi%
- \ifx\pgf@endarrow\pgfutil@empty\else\pgf@drawarrowstrue\fi%
- \ifdim\pgf@shorten@end@additional=0pt\relax\else\pgf@drawarrowstrue\fi%
- \ifdim\pgf@shorten@start@additional=0pt\relax\else\pgf@drawarrowstrue\fi%
- \ifpgf@drawarrows%
- \pgfsyssoftpath@getcurrentpath\pgf@arrowpath%
- \ifx\pgf@arrowpath\pgfutil@empty%
- \pgf@drawarrowsfalse%
- \else%
- \pgfprocesscheckclosed{\pgf@arrowpath}{\pgf@drawarrowsfalse}%
+\newdimen\pgf@shorten@end@additional
+\newdimen\pgf@shorten@start@additional
+
+
+
+%
+%
+% Handling the end of a path
+%
+%
+% The "handling" consists of first testing whether we need to do
+% anything at all, namely because either an arrow tip should be drawn
+% at the end or because the path should be shortened at the end. If
+% so, we shorten the path if needed and, later on, add the arrow tip.
+%
+
+\newif\ifpgf@worry
+
+
+% Prepare the end of the path: Test whether anything must be done
+% (step 0) and, if so, split the path (step 1), extract the interesting points from
+% the path (step 2), prepare further computations (step 3), shorten
+% the path (step 4) if necessary, and add the arrow tip (step 4 in
+% macro \pgf@add@arrow@at@end, which is called later).
+
+\def\pgf@prepare@end@of@path{%
+ \let\pgfprocessresultpathsuffix\relax% flag that nothing has happened...
+ \let\pgfprocessresultsubpathsuffix\relax%
+ \pgfsyssoftpath@getcurrentpath\pgf@arrowpath%
+ %
+ % Step 0 start:
+ %
+ % Do we need to worry about the end?
+ %
+ \ifx\pgf@arrowpath\pgfutil@empty\else%
+ \pgf@worryfalse%
+ \ifx\pgf@end@tip@sequence\pgfutil@empty\else\pgf@worrytrue\fi% Yes, worry if we have to draw an arrow
+ \pgf@precise@shorteningfalse%
+ \pgf@arrow@compute@shortening\pgf@end@tip@sequence%
+ \advance\pgf@xa by\pgf@shorten@end@additional%
+ \advance\pgf@xb by\pgf@shorten@end@additional%
+ \ifdim\pgf@xa=0pt\relax\else\pgf@worrytrue\fi% Also, worry if shortening is requested
+ \edef\pgf@path@shortening@distance{\the\pgf@xa}%
+ \edef\pgf@arrow@tip@total@length{\the\pgf@xb}%
+ %
+ % Step 0 done.
+ %
+ \ifpgf@worry%
+ % Ok, need to "worry" about the end, either because we need to
+ % shorten it or to draw an arrow head.
+ %
+ % Step 1: Split
+ %
+ \pgfprocesssplitpath{\pgf@arrowpath}%
+ \pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@end%
+ %
+ % Step 4: shorten
+ %
+ \ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@end\fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrowpath%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultpathprefix\pgfprocessresultpathsuffix}%
+ \pgfsyssoftpath@setcurrentpath\pgf@arrowpath%
\fi%
\fi%
}
-\newdimen\pgf@shorten@end@additional
-\newdimen\pgf@shorten@start@additional
+\def\pgf@parse@end#1#2#3#4#5#6{%
+ \ifx#4\pgf@stop% Only a moveto! -> do nothing!
+ \def\pgfpointlastonpath{\pgfqpoint{#2}{#3}}%
+ \let\pgf@next\relax%
+ \let\pgf@do@shorten@end\relax%
+ \let\pgf@do@draw@end\pgf@do@draw@straightend%
+ \let\pgf@prep@end\pgf@prep@movetoend%
+ \else\ifx#4\pgfsyssoftpath@curvetosupportatoken% A curve -> this will get complicated...
+ \def\pgfsubpathfourthlasttoken{#1}%
+ \def\pgfpointfourthlastonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointthirdlastonpath{\pgfqpoint{#5}{#6}}%
+ \ifpgf@precise@shortening%
+ \let\pgf@do@shorten@end\pgf@do@shorten@curvedend%
+ \let\pgf@do@draw@end\pgf@do@draw@curvedend%
+ \let\pgf@prep@end\pgf@prep@curveend%
+ \else%
+ \def\pgfsubpathstart{\noexpand#1{#2}{#3}\noexpand#4{#5}{#6}}%
+ \let\pgf@do@shorten@end\pgf@do@shorten@straightend%
+ \let\pgf@do@draw@end\pgf@do@draw@straightend%
+ \let\pgf@prep@end\pgf@prep@straightend%
+ \fi%
+ \let\pgf@next\pgf@parse@end@curve@cont%
+ \else% A straight line -> great!
+ \def\pgfsubpathstart{\noexpand#1{#2}{#3}\noexpand#4}%
+ \def\pgfpointsecondlastonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointlastonpath{\pgfqpoint{#5}{#6}}%
+ \let\pgfpointfourthlastonpath\relax%
+ \let\pgfpointthirdlastonpath\relax%
+ \let\pgf@next\pgf@parse@end@gobble@three%
+ \let\pgf@do@shorten@end\pgf@do@shorten@straightend%
+ \let\pgf@do@draw@end\pgf@do@draw@straightend%
+ \let\pgf@prep@end\pgf@prep@straightend%
+ \fi\fi%
+ \pgf@next% Needed for reading rest of path...
+}
-\let\pgf@shorten@end=\pgfutil@empty
-\let\pgf@shorten@start=\pgfutil@empty
+\def\pgf@parse@end@gobble@three#1#2#3{}%
+\def\pgf@parse@end@curve@cont#1#2#3#4#5#6#7#8#9{%
+ \def\pgfpointsecondlastonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointlastonpath{\pgfqpoint{#5}{#6}}%
+ \ifpgf@precise@shortening%
+ \else%
+ \expandafter\def\expandafter\pgfsubpathstart\expandafter{\pgfsubpathstart\noexpand#1{#2}{#3}\noexpand#4}%
+ \fi%
+}
-\def\pgf@shorten@path@as@needed{%
- \pgfprocesspathextractpoints{\pgf@arrowpath}%
- \let\pgf@arrow@next=\pgf@shorten@now%
- \ifx\pgf@shorten@start\pgfutil@empty%
- \ifx\pgf@shorten@end\pgfutil@empty%
- \ifdim\pgf@shorten@end@additional=0pt\relax%
- \ifdim\pgf@shorten@start@additional=0pt\relax%
- \let\pgf@arrow@next=\relax%
- \fi%
+%
+% Preps
+%
+\def\pgf@prep@movetoend{%
+ \pgf@process{\pgfpointlastonpath}%
+ \pgf@xb\pgf@x
+ \pgf@yb\pgf@y
+ \pgf@xc\pgf@x
+ \pgf@yc\pgf@y
+}
+\def\pgf@prep@straightend{%
+ \let\pgf@ref\pgfpointsecondlastonpath
+ \ifx\pgfpointlastonpath\pgfpointsecondlastonpath% degenerate!
+ \ifx\pgfpointthirdlastonpath\relax% cannot help it: really a zero-length path
+ \else%
+ \ifx\pgfpointlastonpath\pgfpointthirdlastonpath% double degenerate!
+ \let\pgf@ref\pgfpointfourthlastonpath% Use third point for reference.
+ \else
+ \let\pgf@ref\pgfpointthirdlastonpath% Use third point for reference.
\fi%
\fi%
\fi%
- \pgf@arrow@next%
+ \pgfpointlineatdistance{\pgf@path@shortening@distance}{\pgfpointlastonpath}{\pgf@ref}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
}
-\def\pgf@shorten@now{%
- {%
- \pgf@x=0pt%
- \pgf@shorten@start%
- \advance\pgf@x by\pgf@shorten@start@additional%
- \pgf@xc=\pgf@x%
- \pgfpointlineatdistance{\pgf@xc}{\pgfpointfirstonpath}{\pgfpointsecondonpath}%
- \global\pgf@xb=\pgf@x%
- \global\pgf@yb=\pgf@y%
- \pgf@process{\pgfpointsecondonpath}%
- \global\advance\pgf@x by\pgf@xa%
- \global\advance\pgf@y by\pgf@ya%
- }%
- \edef\pgfpointfirstonpath{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
- \edef\pgfpointsecondonpath{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+
+%
+% Line shortening for straight lines:
+%
+\def\pgf@do@shorten@straightend{%
+ \edef\pgfprocessresultsubpathsuffix{\pgfsubpathstart{\the\pgf@xa}{\the\pgf@ya}}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgfprocessresultpathsuffix%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultsubpathprefix\pgfprocessresultsubpathsuffix}%
+}
+
+
+%
+% Draw an end arrow by calling an appropriate subfunction, if necessary
+%
+
+\def\pgf@add@arrow@at@end{%
+ \ifx\pgf@arrowpath\pgfutil@empty\else%
+ \ifx\pgf@end@tip@sequence\pgfutil@empty\else%
+ \pgf@do@draw@end%
+ \fi%
+ \fi%
+}
+
+%
+% Draw an end arrow at the end of a straight line
+%
+\def\pgf@do@draw@straightend{%
{%
- \pgf@x=0pt%
- \pgf@shorten@end%
- \advance\pgf@x by\pgf@shorten@end@additional%
- \pgf@xc=\pgf@x%
- \pgfpointlineatdistance{\pgf@xc}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}%
- \global\pgf@xb=\pgf@x%
- \global\pgf@yb=\pgf@y%
- \pgf@process{\pgfpointsecondlastonpath}%
- \global\advance\pgf@x by\pgf@xa%
- \global\advance\pgf@y by\pgf@ya%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgf@arrow@draw@arrow\pgf@end@tip@sequence\pgf@arrow@tip@total@length%
}%
- \edef\pgfpointlastonpath{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
- \edef\pgfpointsecondlastonpath{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
- \pgfprocesspathreplacestartandend{\pgf@arrowpath}{\pgfpointfirstonpath}{\pgfpointlastonpath}%
- \pgfsyssoftpath@setcurrentpath\pgf@arrowpath%
}
-\def\pgf@add@arrows@as@needed{%
- \ifx\pgf@startarrow\pgfutil@empty%
- \else%
- \pgflowlevelobj%
- {\pgftransformarrow{\pgfpointsecondonpath}{\pgfpointfirstonpath}}
- {\pgf@startarrow}%
+
+
+%
+%
+% Handling the start of a path
+%
+%
+% The "handling" is similar to the case for the start of the path. We
+% may be able to skip the splitting if that was done already for the
+% end. Otherwise, things are basically the same.
+%
+
+% Prepare the start of the path: Test whether anything must be done
+% (step 0) and, if so, split the path (step 1) if necesssary, extract
+% the interesting points from the path (step 2), prepare computations
+% (step 3) needed for both shortening and tip adding, shorten the path
+% (step 4), and add the arrow tip (step 5 in macro
+% \pgf@add@arrow@at@start, which is called later).
+
+\def\pgf@prepare@start@of@path{%
+ %
+ % Step 0 start:
+ %
+ % Do we need to worry about the start?
+ %
+ \ifx\pgf@arrowpath\pgfutil@empty\else%
+ \pgf@worryfalse%
+ \ifx\pgf@start@tip@sequence\pgfutil@empty\else\pgf@worrytrue\fi% Yes, worry if we have to draw an arrow
+ \pgf@precise@shorteningfalse%
+ \pgf@arrow@compute@shortening\pgf@start@tip@sequence%
+ \advance\pgf@xa by\pgf@shorten@start@additional%
+ \advance\pgf@xb by\pgf@shorten@start@additional%
+ \ifdim\pgf@xa=0pt\relax\else\pgf@worrytrue\fi% Also, worry if shortening is requested
+ \edef\pgf@path@shortening@distance{\the\pgf@xa}%
+ \edef\pgf@arrow@tip@total@length{\the\pgf@xb}%
+ %
+ % Step 0 done.
+ %
+ \ifpgf@worry%
+ % Ok, need to "worry" about the start, either because we need to
+ % shorten it or to draw an arrow head.
+ %
+ % Step 1: Split
+ %
+ \ifx\pgfprocessresultpathsuffix\relax%
+ % Ok, still need to compute the split:
+ \pgfprocesssplitpath{\pgf@arrowpath}%
+ \fi%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@start%
+ %
+ % Step 4: shorten
+ %
+ \ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@start\fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@arrowpath%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultpathprefix\pgfprocessresultpathsuffix}%
+ \pgfsyssoftpath@setcurrentpath\pgf@arrowpath%
+ \fi%
\fi%
- \ifx\pgf@endarrow\pgfutil@empty%
- \else%
- \pgflowlevelobj%
- {\pgftransformarrow{\pgfpointsecondlastonpath}{\pgfpointlastonpath}}
- {\pgf@endarrow}%
- \fi%
}
-\let\pgf@startarrow=\pgfutil@empty
-\let\pgf@endarrow=\pgfutil@empty
+\def\pgf@parse@start#1#2#3#4#5#6{%
+ \def\pgfpointfirstonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointsecondonpath{\pgfqpoint{#5}{#6}}%
+ \let\pgfpointthirdonpath\relax%
+ \let\pgfpointfourthonpath\relax%
+ \def\pgfsubpathfirsttoken{\noexpand#1}%
+ \def\pgfsubpathsecondtoken{\noexpand#4}%
+ \ifx#4\pgf@stop% Only a moveto! -> do nothing!
+ \let\pgf@next\relax%
+ \let\pgf@do@shorten@start\relax%
+ \let\pgf@prep@start\pgf@prep@movetostart%
+ \let\pgf@do@draw@start\pgf@do@draw@straightstart%
+ \else\ifx#4\pgfsyssoftpath@curvetosupportatoken% A curve -> this will get complicated...
+ \ifpgf@precise@shortening%
+ \let\pgf@next\pgf@parse@start@curve@cont%
+ \let\pgf@do@shorten@start\pgf@do@shorten@curvedstart%
+ \let\pgf@do@draw@start\pgf@do@draw@curvedstart%
+ \let\pgf@prep@start\pgf@prep@curvedstart%
+ \else% can treat the end like a straight line...
+ \let\pgf@next\pgf@parse@start@curve@cont@straight%
+ \let\pgf@do@shorten@start\pgf@do@shorten@straightstart%
+ \let\pgf@do@draw@start\pgf@do@draw@straightstart%
+ \let\pgf@prep@start\pgf@prep@straightstart%
+ \fi%
+ \else% A straight line -> great!
+ \let\pgf@next\pgf@parse@start@till@stop%
+ \let\pgf@do@shorten@start\pgf@do@shorten@straightstart%
+ \let\pgf@do@draw@start\pgf@do@draw@straightstart%
+ \let\pgf@prep@start\pgf@prep@straightstart%
+ \fi\fi%
+ \pgf@next% Needed for reading rest of path...
+}
+
+\def\pgf@parse@start@till@stop#1\pgf@stop\pgf@stop\pgf@stop{\def\pgfsubpathend{#1}}%
+
+\def\pgf@parse@start@curve@cont#1#2#3#4#5#6#7\pgf@stop\pgf@stop\pgf@stop{%
+ \def\pgfpointthirdonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointfourthonpath{\pgfqpoint{#5}{#6}}%
+ \def\pgfsubpathend{#7}%
+}
+
+\def\pgf@parse@start@curve@cont@straight#1#2#3#4#5#6#7\pgf@stop\pgf@stop\pgf@stop{%
+ \def\pgfpointthirdonpath{\pgfqpoint{#2}{#3}}%
+ \def\pgfpointfourthonpath{\pgfqpoint{#5}{#6}}%
+ \def\pgfsubpathend{#1{#2}{#3}#4{#5}{#6}#7}%
+}
+
+%
+% Preps
+%
+\def\pgf@prep@movetostart{%
+ \pgf@process{\pgfpointfirstonpath}%
+ \pgf@xb\pgf@x
+ \pgf@yb\pgf@y
+ \pgf@xc\pgf@x
+ \pgf@yc\pgf@y
+}
+\def\pgf@prep@straightstart{%
+ \let\pgf@ref\pgfpointsecondonpath
+ \ifx\pgfpointfirstonpath\pgfpointsecondonpath% degenerate!
+ \ifx\pgfpointthirdonpath\relax% cannot help it: really a zero-length path
+ \else%
+ \ifx\pgfpointfirstonpath\pgfpointthirdonpath% double degenerate!
+ \let\pgf@ref\pgfpointfourthonpath% Use third point for reference.
+ \else
+ \let\pgf@ref\pgfpointthirdonpath% Use third point for reference.
+ \fi%
+ \fi%
+ \fi%
+ \pgfpointlineatdistance{\pgf@path@shortening@distance}{\pgfpointfirstonpath}{\pgf@ref}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+}
+
+%
+% Line shortening for straight lines:
+%
+\def\pgf@do@shorten@straightstart{%
+ \edef\pgfprocessresultpathsuffix{\pgfsubpathfirsttoken{\the\pgf@xa}{\the\pgf@ya}\pgfsubpathsecondtoken{\the\pgf@xc}{\the\pgf@yc}}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgfprocessresultpathsuffix%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultpathsuffix\pgfsubpathend}%
+}
+
+
+%
+% Draw a start arrow by calling an appropriate subfunction, if necessary
+%
+
+\def\pgf@add@arrow@at@start{%
+ \ifx\pgf@arrowpath\pgfutil@empty\else%
+ \ifx\pgf@start@tip@sequence\pgfutil@empty\else%
+ \pgf@do@draw@start%
+ \fi%
+ \fi%
+}
+
+%
+% Draw an start arrow at the start of a straight line
+%
+\def\pgf@do@draw@straightstart{%
+ {%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgf@arrow@draw@arrow\pgf@start@tip@sequence\pgf@arrow@tip@total@length%
+ }%
+}
+
+
+
+\let\pgf@shorten@end=\pgfutil@empty
+\let\pgf@shorten@start=\pgfutil@empty
+
+
+\endinput%
+
+
+
+
-\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
index b308c5aef8f..54b5afcf6ae 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepatterns.code.tex,v 1.3 2009/07/02 11:43:15 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepatterns.code.tex,v 1.5 2013/11/07 15:45:46 tantau Exp $
% Creates a new uncolored pattern
%
@@ -53,8 +53,8 @@
% }
%
\def\pgfdeclarepatternformonly{%
- \def\pgf@pattern@type{formonly}%
- \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
+ \def\pgf@pattern@type{formonly}%
+ \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
}
@@ -92,8 +92,8 @@
% }
%
\def\pgfdeclarepatterninherentlycolored{%
- \def\pgf@pattern@type{inherentlycolored}%
- \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
+ \def\pgf@pattern@type{inherentlycolored}%
+ \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
}
@@ -101,26 +101,26 @@
\def\pgf@declarepattern@checkarg[#1]{%
- \def\pgf@pattern@tempvars{#1}%
- \ifx\pgf@pattern@tempvars\pgfutil@empty%
- \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type\endcsname%
- \else%
- \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type @mutable\endcsname%
- \fi%
- \pgf@next}
+ \def\pgf@pattern@tempvars{#1}%
+ \ifx\pgf@pattern@tempvars\pgfutil@empty%
+ \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type\endcsname%
+ \else%
+ \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type @mutable\endcsname%
+ \fi%
+ \pgf@next}
\long\def\pgf@declarepatternformonly#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{0}}
-
+
\long\def\pgf@declarepatterninherentlycolored#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{1}}
-
+
\long\def\pgf@declarepatternformonly@mutable#1#2#3#4#5{%
- \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
- \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{2}%
+ \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
+ \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{2}%
}
\long\def\pgf@declarepatterninherentlycolored@mutable#1#2#3#4#5#6{%
- \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
- \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{3}%
+ \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
+ \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{3}%
}
\def\pgf@declarepattern#1#2#3#4#5#6{%
@@ -134,6 +134,7 @@
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsys@beginscope%
+ \pgfsetarrows{-}%
#5%
\pgfsys@endscope%
\pgfsysprotocol@getcurrentprotocol\pgf@pattern@code%
@@ -162,22 +163,22 @@
\expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\pgf@marshal%
}
{%
- \PackageError{pgfcorepatterns}{Pattern `#1' already defined}{}%
+ \pgferror{Pattern `#1' already defined}%
}%
}
\def\pgf@pattern@number{0}%
\def\pgf@declarepatternmutable#1#2#3#4#5#6#7{%
- \pgfutil@ifundefined{pgf@pattern@name@#1}{%
- \expandafter\gdef\csname pgf@pattern@name@#1\endcsname{#1}%
- \expandafter\gdef\csname pgf@pattern@variables@#1\endcsname{#2}%
- \expandafter\gdef\csname pgf@pattern@lowerleft@#1\endcsname{#3}%
- \expandafter\gdef\csname pgf@pattern@upperright@#1\endcsname{#4}%
- \expandafter\gdef\csname pgf@pattern@tilesize@#1\endcsname{#5}%
- \expandafter\long\expandafter\gdef\csname pgf@pattern@code@#1\endcsname{#6}%
- \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{7}%
- }{\PackageError{pgfcorepatterns}{The pattern `#1' is already defined}{}}%
+ \pgfutil@ifundefined{pgf@pattern@name@#1}{%
+ \expandafter\gdef\csname pgf@pattern@name@#1\endcsname{#1}%
+ \expandafter\gdef\csname pgf@pattern@variables@#1\endcsname{#2}%
+ \expandafter\gdef\csname pgf@pattern@lowerleft@#1\endcsname{#3}%
+ \expandafter\gdef\csname pgf@pattern@upperright@#1\endcsname{#4}%
+ \expandafter\gdef\csname pgf@pattern@tilesize@#1\endcsname{#5}%
+ \expandafter\long\expandafter\gdef\csname pgf@pattern@code@#1\endcsname{#6}%
+ \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{7}%
+ }{\pgferror{The pattern `#1' is already defined}}%
}
\def\pgf@ifpatternisinherentlycolored#1#2#3{%
@@ -210,49 +211,49 @@
% \pgfsetfillpattern{stars}{red}
%
\def\pgfsetfillpattern#1#2{%
- \pgfutil@ifundefined{pgf@pattern@name@#1}%
- {%
- \PackageError{pgfcorepatterns}{Undefined pattern `#1'}{}%
- }%
- {%
- \pgf@ifpatternismutable{#1}%
- {%
- % So, a mutable pattern. Check to see if the pattern
- % has been used with the current variable values...
- \let\pgf@pattern@tempvars\pgfutil@empty%
- \expandafter\expandafter\expandafter\pgf@pattern@check@vars%
- \csname pgf@pattern@variables@#1\endcsname,\pgf@stop,%
- \edef\pgf@pattern@nametemp{pgf@pattern@#1@\pgf@pattern@tempvars}%
- \expandafter\pgfutil@ifundefined\expandafter{\pgf@pattern@nametemp}%
- {%
- % ...Nope. So declare a new instance of the mutable pattern.
- \pgf@ifpatternisinherentlycolored{#1}%
- {\let\pgf@set@fillpattern@declare\pgfdeclarepatterninherentlycolored}%
- {\let\pgf@set@fillpattern@declare\pgfdeclarepatternformonly}%
- \pgf@set@fillpattern@declare%
- {\pgf@pattern@nametemp}%
- {\csname pgf@pattern@lowerleft@#1\endcsname}%
- {\csname pgf@pattern@upperright@#1\endcsname}%
- {\csname pgf@pattern@tilesize@#1\endcsname}%
- {\csname pgf@pattern@code@#1\endcsname}%
- }%
- {%
- % ...Yep. So do nothing.
- }%
- \expandafter\pgf@set@fillpattern\expandafter{\pgf@pattern@nametemp}{#2}%
- \expandafter\gdef\csname\pgf@pattern@nametemp\endcsname{#1}%
- }%
- {%
- % A non-mutable pattern.
- \pgf@set@fillpattern{#1}{#2}%
- }%
- }%
+ \pgfutil@ifundefined{pgf@pattern@name@#1}%
+ {%
+ \pgferror{Undefined pattern `#1'}%
+ }%
+ {%
+ \pgf@ifpatternismutable{#1}%
+ {%
+ % So, a mutable pattern. Check to see if the pattern
+ % has been used with the current variable values...
+ \let\pgf@pattern@tempvars\pgfutil@empty%
+ \expandafter\expandafter\expandafter\pgf@pattern@check@vars%
+ \csname pgf@pattern@variables@#1\endcsname,\pgf@stop,%
+ \edef\pgf@pattern@nametemp{pgf@pattern@#1@\pgf@pattern@tempvars}%
+ \expandafter\pgfutil@ifundefined\expandafter{\pgf@pattern@nametemp}%
+ {%
+ % ...Nope. So declare a new instance of the mutable pattern.
+ \pgf@ifpatternisinherentlycolored{#1}%
+ {\let\pgf@set@fillpattern@declare\pgfdeclarepatterninherentlycolored}%
+ {\let\pgf@set@fillpattern@declare\pgfdeclarepatternformonly}%
+ \pgf@set@fillpattern@declare%
+ {\pgf@pattern@nametemp}%
+ {\csname pgf@pattern@lowerleft@#1\endcsname}%
+ {\csname pgf@pattern@upperright@#1\endcsname}%
+ {\csname pgf@pattern@tilesize@#1\endcsname}%
+ {\csname pgf@pattern@code@#1\endcsname}%
+ }%
+ {%
+ % ...Yep. So do nothing.
+ }%
+ \expandafter\pgf@set@fillpattern\expandafter{\pgf@pattern@nametemp}{#2}%
+ \expandafter\gdef\csname\pgf@pattern@nametemp\endcsname{#1}%
+ }%
+ {%
+ % A non-mutable pattern.
+ \pgf@set@fillpattern{#1}{#2}%
+ }%
+ }%
}
\def\pgf@set@fillpattern#1#2{%
\pgfutil@ifundefined{pgf@pattern@name@#1}{%
- \PackageError{pgfcorepatterns}{Undefined pattern `#1'}{}}
+ \pgferror{Undefined pattern `#1'}}
{%
\csname pgf@pattern@instantiate@#1\endcsname%
\expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\relax%
@@ -273,24 +274,24 @@
}
\def\pgf@pattern@check@vars#1,{%
- \ifx#1\pgf@stop%
- \let\pgf@next\relax%
- \else%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\let\expandafter\pgf@pattern@char#1#1\pgfmath@%
- \ifx\pgf@pattern@char/%
- \edef\pgf@pattern@tempvar{(\pgfkeysvalueof{#1})}%
- \else%
- \expandafter\ifcat\pgf@pattern@char\relax%
- \edef\pgf@pattern@tempvar{(\the#1)}%
- \else%
- \edef\pgf@pattern@tempvar{(#1)}%
- \fi%
- \fi%
- \edef\pgf@pattern@tempvars{\pgf@pattern@tempvars\pgf@pattern@tempvar}%
- \let\pgf@next\pgf@pattern@check@vars%
- \fi%
- \pgf@next%
+ \ifx#1\pgf@stop%
+ \let\pgf@next\relax%
+ \else%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\let\expandafter\pgf@pattern@char#1#1\pgfmath@%
+ \ifx\pgf@pattern@char/%
+ \edef\pgf@pattern@tempvar{(\pgfkeysvalueof{#1})}%
+ \else%
+ \expandafter\ifcat\pgf@pattern@char\relax%
+ \edef\pgf@pattern@tempvar{(\the#1)}%
+ \else%
+ \edef\pgf@pattern@tempvar{(#1)}%
+ \fi%
+ \fi%
+ \edef\pgf@pattern@tempvars{\pgf@pattern@tempvars\pgf@pattern@tempvar}%
+ \let\pgf@next\pgf@pattern@check@vars%
+ \fi%
+ \pgf@next%
}
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
index 79cb3a06f77..b546d5df40f 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.20 2010/04/09 08:53:45 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.27 2013/10/07 15:51:46 tantau Exp $
\newdimen\pgf@picminx
\newdimen\pgf@picmaxx
@@ -99,10 +99,6 @@
% point yourself. In the below example, this command is used for a low level
% coordinate system shift.
%
-% In addition to applying the transformation matrix to the given
-% point, this function also applies the pre- and post-morphing
-% macros.
-%
% Example:
%
% \begin{pgflowleveltransformshiftscope}{\pgfpointtransformed{\pgfpointorigin}}
@@ -112,9 +108,7 @@
\def\pgfpointtransformed#1{%
\pgf@process{%
#1%
- \pgfmorph@prelist%
\pgf@pos@transform{\pgf@x}{\pgf@y}%
- \pgfmorph@postlist%
}%
}
@@ -201,7 +195,7 @@
% \pgfpointintersectionoflines{\pgfpointxy{0}{1}}{\pgfpointxy{1}{0}}{\pgfpointxy{2}{2}}{\pgfpointxy{3}{4}}
\def\pgfpointintersectionoflines#1#2#3#4{%
- {
+ {%
%
% Compute orthogonal vector to #1--#2
%
@@ -439,6 +433,9 @@
%
% x = x-component of #1*start + (1-#1)*end
% y = y-component of #1*start + (1-#1)*end
+% xa/ya = #1*start + (1-#1)*end
+% xb/yb = start point
+% xc/yc = end point
%
% Example:
%
@@ -447,14 +444,19 @@
\def\pgfpointlineattime#1#2#3{%
\pgf@process{#3}%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgf@xc\pgf@x%
+ \pgf@yc\pgf@y%
\pgf@process{#2}%
- \advance\pgf@xa by-\pgf@x\relax%
- \advance\pgf@ya by-\pgf@y\relax%
- \advance\pgf@x by #1\pgf@xa\relax%
- \advance\pgf@y by #1\pgf@ya\relax%
- \ignorespaces}
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgfmathsetmacro\pgf@temp{#1}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \advance\pgf@x by\pgf@temp\pgf@xa%
+ \advance\pgf@y by\pgf@temp\pgf@ya%
+}
% Move point #2 #1 many units in the direction of #3.
@@ -462,27 +464,35 @@
% #1 = a distance
% #2 = start point
% #3 = end point
+%
+% Description:
+%
+% Computes
%
-% x = x-component of start + #1*(normalise(end-start))
-% y = y-component of start + #1*(normalise(end-start))
-% xa = #1*(normalise(end-start))
-% ya = #1*(normalise(end-start))
+% x/y = start + #1*(normalise(end-start))
%
-% Example:
+% and additionally
%
+% xa/ya = #1*(normalise(end-start))
+% xb/yb = start
+% xc/yc = end
+%
+% Example:
%
% \pgfpathmoveto{\pgfpointlineatdistance{2pt}{\pgfpointxy{0}{1}}{\pgfpointxy{2}{3}}}
% \pgfpathlineto{\pgfpointlineatdistance{3pt}{\pgfpointxy{2}{3}}{\pgfpointxy{0}{1}}}
\def\pgfpointlineatdistance#1#2#3{%
+ \pgfmathsetlength\pgf@xa{#1}%
\pgf@process{#2}%
- \pgf@xb=\pgf@x\relax% xb/yb = start point
- \pgf@yb=\pgf@y\relax%
+ \pgf@xb\pgf@x% xb/yb = start point
+ \pgf@yb\pgf@y%
\pgf@process{#3}%
+ \pgf@xc\pgf@x%
+ \pgf@yc\pgf@y%
\advance\pgf@x by-\pgf@xb\relax%
\advance\pgf@y by-\pgf@yb\relax%
\pgf@process{\pgfpointnormalised{}}% x/y = normalised vector
- \pgfmathsetlength\pgf@xa{#1}%
\pgf@ya=\pgf@xa\relax%
\pgf@xa=\pgf@sys@tonumber{\pgf@x}\pgf@xa%
\pgf@ya=\pgf@sys@tonumber{\pgf@y}\pgf@ya%
@@ -490,7 +500,7 @@
\pgf@y=\pgf@yb\relax%
\advance\pgf@x by\pgf@xa\relax%
\advance\pgf@y by\pgf@ya\relax%
- \ignorespaces}
+}
% Returns point on a curve from #2 to #5 with controls #3 and #4 at time #1.
@@ -506,7 +516,9 @@
%
% Additionally, (\pgf@xa,\pgf@ya) and (\pgf@xb,\pgf@yb) will be on a
% tangent to the point on the curve (this can be useful for computing
-% a label rotation).
+% a label rotation). (\pgf@xc,\pgf@yc) will be equal to the end
+% point. \pgf@time@s will equal the value of #1 and \pgf@time@t will
+% equal 1-#1.
%
% Example:
%
@@ -552,6 +564,58 @@
+% Returns point on an arc at a certain "time"
+%
+% #1 = a time
+% #2 = center of a ellipse
+% #3 = 0-degree exis of the ellipse
+% #4 = 90-degree exis of the ellipse
+% #5 = start angle of an arc on the ellipse
+% #6 = end angle of an arc on the ellipse
+%
+% Result:
+%
+% \pgf@x = x-component of place on the arc at time t
+% \pgf@y = y-component of place on the arc at time t
+%
+% Additionally, (\pgf@xa,\pgf@ya) will be a tangent to the
+% point on the arc (this can be useful for computing a label rotation).
+%
+% Example:
+%
+% \pgfpointarcaxesattime{0.25}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{1cm}}{1cm}{30}{40}
+
+\def\pgfpointarcaxesattime#1#2#3#4#5#6{%
+ \pgfmathsetmacro\pgf@angle@start{#5}%
+ \pgfmathsetmacro\pgf@angle@end{#6}%
+ \pgfmathparse{#1}%
+ \pgf@x=\pgfmathresult pt%
+ \pgf@x=-\pgf@x%
+ \advance\pgf@x by 1pt%
+ \pgfmathsetmacro\pgf@angle@mid{\pgf@angle@end*\pgfmathresult+\pgf@angle@start*\pgf@sys@tonumber{\pgf@x}}%
+ \pgfmathcos@{\pgf@angle@mid}%
+ \let\pgf@angle@cos\pgfmathresult%
+ \pgfmathsin@{\pgf@angle@mid}%
+ \let\pgf@angle@sin\pgfmathresult%
+ \pgf@process{#3}%
+ \edef\pgf@angle@zero@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \pgf@process{#4}%
+ \edef\pgf@angle@ninety@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ % Compute tangent
+ \pgf@process{\pgfpointadd{\pgfpointscale{\pgf@angle@sin}{\pgf@angle@zero@axis}}%
+ {\pgfpointscale{-\pgf@angle@cos}{\pgf@angle@ninety@axis}}}%
+ \ifdim\pgf@angle@start pt>\pgf@angle@end pt%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \else%
+ \pgf@xa=-\pgf@x%
+ \pgf@ya=-\pgf@y%
+ \fi%
+ % Compute position
+ \pgf@process{\pgfpointadd{#2}{%
+ \pgfpointadd{\pgfpointscale{\pgf@angle@cos}{\pgf@angle@zero@axis}}%
+ {\pgfpointscale{\pgf@angle@sin}{\pgf@angle@ninety@axis}}}}%
+}
@@ -1202,4 +1266,13 @@
\pgf@def{cosfrac}{97}{0.717792} \pgf@def{cosfrac}{98}{0.714213}
\pgf@def{cosfrac}{99}{0.710651} \pgf@def{cosfrac}{100}{0.707107}
+
+
+
+% Forward declarations for nonlinear stuff (have no effect till module
+% nonlineartransformations is loaded)
+
+\let\pgfpointtransformednonlinear\pgfpointtransformed
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
index 558f715788c..406d52e3a22 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.34 2010/09/08 15:07:18 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.44 2013/10/09 18:30:27 tantau Exp $
% Globals
@@ -50,10 +50,14 @@
\pgfsys@beginscope%
\pgf@resetpathsizes%
\edef\pgfscope@linewidth{\the\pgflinewidth}%
+ \expandafter\let\expandafter\pgfscope@stroke@color\csname\string\color@pgfstrokecolor\endcsname%
+ \expandafter\let\expandafter\pgfscope@fill@color\csname\string\color@pgffillcolor\endcsname%
\begingroup}
\def\endpgfscope{%
\endgroup%
\global\pgflinewidth=\pgfscope@linewidth%
+ \expandafter\global\expandafter\let\csname\string\color@pgfstrokecolor\endcsname\pgfscope@stroke@color%
+ \expandafter\global\expandafter\let\csname\string\color@pgffillcolor\endcsname\pgfscope@fill@color%
\pgfsys@endscope}
@@ -116,6 +120,8 @@
\expandafter\pgf@text@setkeys\expandafter{\pgf@text@options}%
\csname pgf@halign\pgf@text@hshift\endcsname%
\csname pgf@valign\pgf@text@vshift\endcsname%
+ %
+ \pgfapproximatenonlineartransformation%
% Protocol sizes:
\pgf@process{\pgfpointtransformed{\pgfqpoint{0pt}{\dp\pgf@hbox}}}%
\pgf@protocolsizes{\pgf@x}{\pgf@y}%
@@ -190,8 +196,6 @@
% \pgfusepath{stroke}
% \end{pgfpicture}
-\newif\ifpgfpicture
-
\def\pgfresetboundingbox{%
\global\pgf@picmaxx=-16000pt\relax%
\global\pgf@picminx=16000pt\relax%
@@ -257,23 +261,26 @@
\pgf@relevantforpicturesizefalse%
\pgf@process{\pgf@baseline}%
\xdef\pgf@shift@baseline{\the\pgf@y}%
- %
+ %
\pgf@process{\pgf@trimleft}%
\global\advance\pgf@x by-\pgf@picminx
- % prepare \hskip\pgf@trimleft@final.
+ % prepare \hskip\pgf@trimleft@final.
% note that \pgf@trimleft@final is also queried
% by the pgf image externalization.
\xdef\pgf@trimleft@final{-\the\pgf@x}%
- %
+ %
\pgf@process{\pgf@trimright}%
\global\advance\pgf@x by-\pgf@picmaxx
- % prepare \hskip\pgf@trimright@final.
+ % prepare \hskip\pgf@trimright@final.
% note that \pgf@trimright@final is also queried
% by the pgf image externalization.
\xdef\pgf@trimright@final{\the\pgf@x}%
+ %
+ \pgf@remember@layerlist@globally
\endgroup%
\hss%
\egroup%
+ \pgf@restore@layerlist@from@global
\pgf@insertlayers%
\endgroup%
\pgfsys@discardpath%
@@ -287,6 +294,12 @@
\endgroup%
}
+\def\pgf@remember@layerlist@globally{%
+ \global\let\pgf@layerlist@=\pgf@layerlist
+}%
+\def\pgf@restore@layerlist@from@global{%
+ \let\pgf@layerlist=\pgf@layerlist@
+}%
\def\pgf@insertlayers{%
\box\pgf@layerbox@main%
}
@@ -356,20 +369,20 @@
% \pgfsetbaseline{default}% resets to default value
\def\pgfsetbaseline#1{%
- \def\pgf@temp{#1}%
- \ifx\pgf@temp\pgf@default@text
- \pgfsetbaseline{\pgf@picminy}%
- \else
- \pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}%
- \fi
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsetbaseline{\pgf@picminy}%
+ \else
+ \pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}%
+ \fi
}
\pgfsetbaseline{\pgf@picminy}
% controls how the image externalization implements trim:
\newif\ifpgf@trim@lowlevel
\pgfkeys{
- /pgf/trim lowlevel/.is if=pgf@trim@lowlevel,
- /pgf/trim lowlevel/.default=true,
+ /pgf/trim lowlevel/.is if=pgf@trim@lowlevel,
+ /pgf/trim lowlevel/.default=true,
}
% Same as the y-baseline for horizontal alignment.
@@ -385,12 +398,12 @@
% or
% \pgfsettrimleft{default}
\def\pgfsettrimleft#1{%
- \def\pgf@temp{#1}%
- \ifx\pgf@temp\pgf@default@text
- \pgfsettrimleft{\pgf@picminx}
- \else
- \pgfsettrimleftpointlater{\pgfpoint{#1}{0pt}}%
- \fi
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimleft{\pgf@picminx}
+ \else
+ \pgfsettrimleftpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
}
\pgfsettrimleft{\pgf@picminx}
@@ -404,12 +417,12 @@
% or
% \pgfsettrimright{default}
\def\pgfsettrimright#1{%
- \def\pgf@temp{#1}%
- \ifx\pgf@temp\pgf@default@text
- \pgfsettrimright{\pgf@picmaxx}%
- \else
- \pgfsettrimrightpointlater{\pgfpoint{#1}{0pt}}%
- \fi
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimright{\pgf@picmaxx}%
+ \else
+ \pgfsettrimrightpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
}
\pgfsettrimright{\pgf@picmaxx}
@@ -445,6 +458,7 @@
\pgfsyssoftpath@setcurrentpath\pgfutil@empty%
\edef\pgfscope@linewidth{\the\pgflinewidth}%
\let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto%
+ \let\pgf@interrupt@nlt@infos=\pgf@nlt@infos%
\begingroup%
}
\def\endpgfinterruptpath
@@ -453,9 +467,10 @@
\global\pgflinewidth=\pgfscope@linewidth%
\pgfsyssoftpath@setcurrentpath\pgf@interrupt@path%
\pgf@setpathsizes\pgf@interrupt@pathsizes%
- \global\pgf@path@lastx=\pgf@interrupt@savex%
- \global\pgf@path@lasty=\pgf@interrupt@savey%
- \global\let\pgfsyssoftpath@lastmoveto=\pgf@interrupt@lastmoveto%
+ \global\pgf@path@lastx\pgf@interrupt@savex%
+ \global\pgf@path@lasty\pgf@interrupt@savey%
+ \global\let\pgfsyssoftpath@lastmoveto\pgf@interrupt@lastmoveto%
+ \global\let\pgf@nlt@infos=\pgf@interrupt@nlt@infos%
\endgroup%
}
@@ -570,5 +585,4 @@
\let\pgf@savelayers=\relax
\let\pgf@restorelayers=\relax
-
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
index d4b0e8bee74..86bd57c32fe 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.13 2008/11/23 16:07:47 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.15 2013/07/15 14:24:02 tantau Exp $
%
% Parsing functions
@@ -133,8 +133,8 @@
\pgfutil@ifnextchar g{\pgf@grabgray}%
{%
\pgfutil@ifnextchar c{\pgf@grabcolor}%
- {\PackageError{pgfshade}{Illformed shading
- specification}{}\pgf@converttorgb}%
+ {\pgferror{Illformed shading
+ specification}\pgf@converttorgb}%
}%
}%
}%
@@ -424,7 +424,7 @@
\edef\pgf@shadingname{@pgfshading#1}%
\pgf@tryextensions{\pgf@shadingname}{\pgfalternateextension}%
\expandafter\pgfutil@ifundefined\expandafter{\pgf@shadingname}%
- {\PackageError{pgfshade}{Undefined shading "#1"}{}}%
+ {\pgferror{Undefined shading "#1"}}%
{%
{%
\pgfutil@globalcolorsfalse%
@@ -531,22 +531,25 @@
\def\pgfshadepath#1#2{%
\ifdim\pgf@pathminx=16000pt%
- \PackageWarning{pgfshade}{No path specified that can be filled}%
+ \pgfwarning{No path specified that can be filled}%
\else%
\begingroup%
+ % Calculate center:
+ \pgf@xb=.5\pgf@pathmaxx%
+ \advance\pgf@xb by.5\pgf@pathminx%
+ \pgf@yb=.5\pgf@pathmaxy%
+ \advance\pgf@yb by.5\pgf@pathminy%
+ % Calculate scaling:
+ \pgf@xc=\pgf@pathmaxx%
+ \advance\pgf@xc by-\pgf@pathminx%
+ \pgf@yc=\pgf@pathmaxy%
+ \advance\pgf@yc by-\pgf@pathminy%
+ \pgf@xc=.01992528\pgf@xc%
+ \pgf@yc=.01992528\pgf@yc%
+ \ifdim\pgf@xc<0.0001pt\relax\ifdim\pgf@xc>-0.0001pt\relax\pgf@no@shadetrue\fi\fi%
+ \ifdim\pgf@yc<0.0001pt\relax\ifdim\pgf@yc>-0.0001pt\relax\pgf@no@shadetrue\fi\fi%
+ \ifpgf@no@shade\else%
\pgfsys@beginscope%
- % Calculate center:
- \pgf@xb=.5\pgf@pathmaxx%
- \advance\pgf@xb by.5\pgf@pathminx%
- \pgf@yb=.5\pgf@pathmaxy%
- \advance\pgf@yb by.5\pgf@pathminy%
- % Calculate scaling:
- \pgf@xc=\pgf@pathmaxx%
- \advance\pgf@xc by-\pgf@pathminx%
- \pgf@yc=\pgf@pathmaxy%
- \advance\pgf@yc by-\pgf@pathminy%
- \pgf@xc=.01992528\pgf@xc%
- \pgf@yc=.01992528\pgf@yc%
\pgfsyssoftpath@invokecurrentpath%
\pgfsys@clipnext%
\pgfsys@discardpath%
@@ -570,10 +573,12 @@
\fi%
\pgfuseshading{#1}%
\pgfsys@endscope%
+ \fi%
\endgroup%
\fi%
}
+\newif\ifpgf@no@shade
% Additionally transform shade paths
%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
index 442531ffa6f..83f89b1fa2d 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.11 2009/06/10 09:22:57 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.17 2013/10/10 08:53:09 tantau Exp $
% Position transformations
@@ -57,15 +57,15 @@
%
% \pgfsettransformentries\aa\ab\ba\bb\shiftx\shifty
\def\pgfgettransformentries#1#2#3#4#5#6{%
- \edef#1{\pgf@pt@aa}%
- \edef#2{\pgf@pt@ab}%
- \edef#3{\pgf@pt@ba}%
- \edef#4{\pgf@pt@bb}%
- \edef#5{\the\pgf@pt@x}%
- \edef#6{\the\pgf@pt@y}%
+ \edef#1{\pgf@pt@aa}%
+ \edef#2{\pgf@pt@ab}%
+ \edef#3{\pgf@pt@ba}%
+ \edef#4{\pgf@pt@bb}%
+ \edef#5{\the\pgf@pt@x}%
+ \edef#6{\the\pgf@pt@y}%
}%
\def\pgfsettransformentries#1#2#3#4#5#6{%
- \pgfsettransform{{#1}{#2}{#3}{#4}{#5}{#6}}%
+ \pgfsettransform{{#1}{#2}{#3}{#4}{#5}{#6}}%
}%
% Restore the current transformation matrix from a macro.
@@ -273,41 +273,6 @@
}
-% Add a pre-morph
-%
-% #1 = morphing code
-%
-% Description:
-%
-% This function adds code to the pre-morphing list. When a
-% coordinate is transformed, the current pre-morphing code is
-% called first. Then the transformation matrix is applied. Finally, all
-% post-morphing code is called. The morphing list is local to the
-% current TeX group.
-%
-% The job of the #1 macro is to modify the values of \pgf@x and
-% \pgf@y. It should not have any other sideeffects.
-%
-% Example:
-%
-% \pgfmorphaddmorph{\advance\pgf@x by 1cm\relax}
-
-\def\pgfmorphaddpre#1{\expandafter\def\expandafter\pgfmorph@prelist\expandafter{\pgfmorph@prelist#1}}
-\let\pgfmorph@prelist=\pgfutil@empty
-
-
-% Add a post-morph
-%
-% #1 = morphing macro
-%
-% Description:
-%
-% The only difference to the pre-morphs is that post morphs are
-% executed after the transformation matrix has been applied.
-
-\def\pgfmorphaddpost#1{\expandafter\def\expandafter\pgfmorph@postlist\expandafter{\pgfmorph@postlist#1}}
-\let\pgfmorph@postlist=\pgfutil@empty
-
% Transformation into a given triangle. The three corners of the
% triangle are called "origin", "x" and "y" are given. After this
@@ -385,9 +350,9 @@
%
% \pgftansformshift{\pgfpoint{1cm}{1cm}}
-\def\pgftransformshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{#1}}
-\def\pgftransformxshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{\pgfpoint{#1}{0pt}}}
-\def\pgftransformyshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{\pgfpoint{0pt}{#1}}}
+\def\pgftransformshift#1{\pgftransformcm{1}{0}{0}{1}{#1}}
+\def\pgftransformxshift#1{\pgftransformcm{1}{0}{0}{1}{\pgfpoint{#1}{+0pt}}}
+\def\pgftransformyshift#1{\pgftransformcm{1}{0}{0}{1}{\pgfpoint{+0pt}{#1}}}
@@ -487,25 +452,71 @@
% }
%
\def\pgftransformlineattime#1#2#3{%
- \pgftransformshift{\pgfpointlineattime{#1}{#2}{#3}}%
+ \pgf@process{#2}%
+ \pgf@xb=\pgf@x% xb/yb = start point
+ \pgf@yb=\pgf@y%
+ \pgf@process{#3}%
+ \pgf@xc=\pgf@x% xc/yc = end point
+ \pgf@yc=\pgf@y%
+ \pgftransformshift{\pgfpointlineattime{#1}{\pgfqpoint{\pgf@xb}{\pgf@yb}}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}%
+ \ifpgfresetnontranslationattime%
+ \pgftransformresetnontranslations%
+ \fi%
+ \ifpgfslopedattime%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \ifpgfallowupsidedownattime%
+ \else%
+ \ifdim\pgf@xc<0pt%
+ \pgf@xc=-\pgf@xc%
+ \pgf@yc=-\pgf@yc%
+ \fi%
+ \fi%
+ \pgf@x=\pgf@xc%
+ \pgf@y=\pgf@yc%
+ \pgfpointnormalised{}% x/y = normalised vector
+ \pgf@ya=-\pgf@y%
+ \pgftransformcm%
+ {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
+ {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}%
+ \fi%
+}
+
+
+% Transform to the coordinate system of a point on an arc
+%
+% #1 = a time fraction of line where to put the label, where 0 means start,
+% 1 means end, and for example 0.5 means the middle.
+% #2 = center of an ellipse
+% #3 = 0-degree axis of the ellipse
+% #4 = 90-degree axis of the ellipse
+% #4 = start angle of the arc on this ellipse
+% #5 = end angle of the arc on this ellipse
+%
+% Example:
+%
+% {
+% \pgftransformlineattime{.5}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{1cm}}{30}{40}
+% \pgftext{Hi!}
+% }
+
+\def\pgftransformarcaxesattime#1#2#3#4#5#6{%
+ \pgfpointarcaxesattime{#1}{#2}{#3}{#4}{#5}{#6}%
+ \pgftransformshift{\pgfqpoint{\pgf@x}{\pgf@y}}%
\ifpgfresetnontranslationattime%
\pgftransformresetnontranslations%
\fi%
\ifpgfslopedattime%
- \pgf@process{#2}%
- \pgf@xa=\pgf@x% xb/yb = start point
- \pgf@ya=\pgf@y%
- \pgf@process{#3}%
- \advance\pgf@x by-\pgf@xa%
- \advance\pgf@y by-\pgf@ya%
+ \pgf@x=\pgf@xa%
+ \pgf@y=\pgf@ya%
+ \pgf@process{\pgfpointnormalised{}}%
\ifpgfallowupsidedownattime%
\else%
- \ifdim\pgf@x<0pt%
+ \ifdim\pgf@x<0pt%
\pgf@x=-\pgf@x%
\pgf@y=-\pgf@y%
\fi%
\fi%
- \pgfpointnormalised{}% x/y = normalised vector
\pgf@ya=-\pgf@y%
\pgftransformcm%
{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
@@ -579,8 +590,8 @@
% \pgftransformarrow{\pgfpointorigin}{\pgfpoint{1cm}{0cm}}
\def\pgftransformarrow#1#2{%
- \pgftransformshift{#2}%
\pgf@process{#2}%
+ \pgftransformshift{}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{#1}%
@@ -658,5 +669,13 @@
+% Forward declarations for nonlinear stuff (have no effect till module
+% nonlineartransformations is loaded)
+
+\let\pgfapproximatenonlineartranslation\relax
+\let\pgfapproximatenonlineartransformation\relax
+\def\pgftransformnonlinear#1{\pgferror{You need to say
+ \string\usepgfmodule{nonlineartransformation} to use nonlinear transformations}}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
index 3048e6077fe..47484997af7 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransparency.code.tex,v 1.2 2008/01/17 20:09:16 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransparency.code.tex,v 1.5 2013/09/30 18:30:15 tantau Exp $
% Sets the opacity of stroking operations.
@@ -39,6 +39,37 @@
+% Sets the current blend mode. See Section 7.2.4 of the PDF
+% Specification 1.7 for an introduction to blend modes in general.
+%
+% #1 = One of the following modes, see also section 7.2.4 of the
+% PDF Specification 1.7. (The PGF names, which are all lowercase with
+% spaces as usual, must be mapped to the PDF or SVG by the drivers.)
+%
+% normal
+% multiply
+% screen
+% overlay
+% darken
+% lighten
+% color dodge
+% color burn
+% hard light
+% soft light
+% difference
+% exclusion
+% saturation
+% color
+% hue
+% luminosity
+%
+% Example:
+%
+% \pgfsetblendmode{multiply}
+
+\def\pgfsetblendmode#1{\pgfsys@blend@mode{#1}}
+
+
% Declares a new fading based on the contents of a box.
%
% #1 = name of the fading
@@ -156,8 +187,10 @@
% Calculate scaling:
\pgf@xc=\pgf@pathmaxx%
\advance\pgf@xc by-\pgf@pathminx%
+ \ifdim\pgf@xc<0.1pt\pgf@xc=0.1pt\fi%
\pgf@yc=\pgf@pathmaxy%
\advance\pgf@yc by-\pgf@pathminy%
+ \ifdim\pgf@yc<0.1pt\pgf@yc=0.1pt\fi%
\pgf@xc=.02\pgf@xc%
\pgf@yc=.02\pgf@yc%
% Compute new transformation matrix:
@@ -171,6 +204,49 @@
+% Use a previously declared fading scaled for the current path.
+%
+% #1 - an fading
+% #2 - extra transformations
+%
+% Description:
+%
+% This command works like \pgfsetfadingforcurrentpath, only it takes
+% the current line width into account: Before the path is considered,
+% it is enlarged by half the line width in all directions.
+
+\def\pgfsetfadingforcurrentpathstroked#1#2{%
+ \ifdim\pgf@pathminx=16000pt%
+ % Path was empty -> use natural size
+ \pgfsetfading{#1}{#2}%
+ \else%
+ \pgfsetfading{#1}{%
+ % Calculate center:
+ \pgf@xb=.5\pgf@pathmaxx%
+ \advance\pgf@xb by.5\pgf@pathminx%
+ \pgf@yb=.5\pgf@pathmaxy%
+ \advance\pgf@yb by.5\pgf@pathminy%
+ % Calculate scaling:
+ \pgf@xc=\pgf@pathmaxx%
+ \advance\pgf@xc by-\pgf@pathminx%
+ \advance\pgf@xc by\pgflinewidth%
+ \ifdim\pgf@xc<0.1pt\pgf@xc=0.1pt\fi%
+ \pgf@yc=\pgf@pathmaxy%
+ \advance\pgf@yc by-\pgf@pathminy%
+ \advance\pgf@yc by\pgflinewidth%
+ \ifdim\pgf@yc<0.1pt\pgf@yc=0.1pt\fi%
+ \pgf@xc=.02\pgf@xc%
+ \pgf@yc=.02\pgf@yc%
+ % Compute new transformation matrix:
+ \pgftransformcm{1}{0}{0}{1}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgftransformcm{\pgf@sys@tonumber{\pgf@xc}}{0}{0}{\pgf@sys@tonumber{\pgf@yc}}{\pgfpointorigin}%
+ #2%
+ }%
+ \fi%
+}
+
+
+
% Group things in a a transparency group
%
% Description:
@@ -186,9 +262,22 @@
%
\def\pgftransparencygroup{%
+ \pgfutil@ifnextchar[{\pgftransparencygroup@}{\pgftransparencygroup@[]}%
+}
+\def\pgftransparencygroup@[#1]{%
\begingroup%
+ \pgfkeys{/pgf/transparency group options/.cd,%
+ isolated=false,
+ knockout=false,
+ #1}%
\setbox\pgfutil@tempboxa=\hbox\bgroup%
}
+\pgfkeys{
+ /pgf/transparency group options/.cd,
+ isolated/.is if=pgfsys@transparency@group@isolated,
+ knockout/.is if=pgfsys@transparency@group@knockout
+}
+
\def\endpgftransparencygroup{%
\egroup%
% Now compute the correct position. This is a bit tricky...