summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex183
1 files changed, 99 insertions, 84 deletions
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 0c36d3c1a4f..4ca277c9923 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.24 2014/11/02 21:38:01 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcorepathusage.code.tex}
% Stroke/fill/clip/etc. the current path. Depending on the options,
@@ -15,7 +15,7 @@
% are given, the path is stroked. If multiple options are given, all
% of them are performed (in a sensible order).
%
-% #1 = action(s) to be applied to the current path. Valid actions are:
+% #1 = action(s) to be applied to the current path. Valid actions are:
% stroke - strokes the path.
% draw - strokes the path and adds arrow tips.
% tips - adds arrow tips.
@@ -101,11 +101,11 @@
\let\pgf@up@action=\pgfutil@empty%
\ifx\pgf@up@clip\pgfutil@empty%
\else%
- % only clipping
+ % only clipping
\let\pgf@up@action=\pgfsys@discardpath%
\fi%
\fi%
- \fi%
+ \fi%
\pgfsyssoftpath@getcurrentpath\pgf@last@processed@path
\pgfprocessround{\pgf@last@processed@path}{\pgf@last@processed@path}% change the path
\pgfsyssoftpath@setcurrentpath\pgf@last@processed@path%
@@ -139,7 +139,7 @@
\ifnum\pgf@tips@mode=4\relax%
\pgf@up@draw@arrows@only%
\fi%
- \else%
+ \else%
\pgfsyssoftpath@invokecurrentpath%
\pgf@up@action%
\fi%
@@ -149,13 +149,16 @@
\pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
\pgf@path@check@proper%
\ifpgfutil@tempswa%
+ \pgf@check@for@arrow@and@animation%
\pgf@prepare@end@of@path%
\begingroup%
\pgf@prepare@start@of@path%
\fi%
- \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@invokecurrentpath%
\pgf@up@action%
- \pgf@stroke@inner@line@if@needed%
+ \ifdim\pgfinnerlinewidth>0pt\relax%
+ \pgf@stroke@inner@line%
+ \fi%
\ifpgfutil@tempswa%
\pgf@add@arrow@at@start%
\endgroup%
@@ -186,6 +189,7 @@
\pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
\pgf@path@check@proper%
\ifpgfutil@tempswa%
+ \pgf@check@for@arrow@and@animation%
\pgf@prepare@end@of@path%
\begingroup%
\pgf@prepare@start@of@path%
@@ -195,6 +199,22 @@
\fi%
}
+\def\pgf@check@for@arrow@and@animation{\pgfsys@if@fresh@currentid{\pgf@check@for@arrow@and@animation@}{}}%
+\def\pgf@check@for@arrow@and@animation@{%
+ \expandafter\ifx\csname pgfsysanim@path@is@animated@\pgf@sys@id@current@id @\pgfsys@current@type\endcsname\pgfutil@empty%
+ % Ok, an animation is here!
+ \ifx\pgf@end@tip@sequence\pgfutil@empty%
+ \ifx\pgf@start@tip@sequence\pgfutil@empty%
+ \else%
+ \pgf@check@for@arrow@and@animation@error%
+ \fi%
+ \else%
+ \pgf@check@for@arrow@and@animation@error%
+ \fi%
+ \fi%
+}
+\def\pgf@check@for@arrow@and@animation@error{\pgferror{Animated path may not have normal arrow tips. Use a base path with arrow tips}}
+
\def\pgf@path@check@proper{%
\ifpgfutil@tempswa%
\ifnum\pgf@tips@mode>2\relax%
@@ -203,7 +223,6 @@
\fi%
}
-
\def\pgf@path@check@proper@{%
{%
\pgf@x0pt\pgf@y\pgf@x%
@@ -234,24 +253,20 @@
-\def\pgf@stroke@inner@line@if@needed{%
- \ifdim\pgfinnerlinewidth>0pt\relax%
- \let\pgf@temp@save=\pgf@strokecolor@global
- \pgfsys@beginscope%
- {%
- \pgfsys@setlinewidth{\pgfinnerlinewidth}%
- \pgfsetstrokecolor{\pgfinnerstrokecolor}%
- \pgfsyssoftpath@invokecurrentpath%
- \pgfsys@stroke%
- }%
- \pgfsys@endscope%
- \global\let\pgf@strokecolor@global=\pgf@temp@save
- \fi%
+\def\pgf@stroke@inner@line{%
+ \let\pgf@temp@save=\pgf@strokecolor@global
+ \pgfsys@beginscope%
+ {%
+ \pgfsys@setlinewidth{\pgfinnerlinewidth}%
+ \pgfsetstrokecolor{\pgfinnerstrokecolor}%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@stroke%
+ }%
+ \pgfsys@endscope%
+ \global\let\pgf@strokecolor@global=\pgf@temp@save
}
\let\pgf@prepare@start@of@path\relax%
-\let\pgf@add@arrow@at@end\relax%
-\let\pgf@add@arrow@at@start\relax%
@@ -278,11 +293,11 @@
-%
-%
-% Handling the end of a path
-%
-%
+%
+%
+% 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
@@ -296,20 +311,23 @@
% (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).
+% 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?
- %
+ %
+ % 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
+ \ifx\pgf@end@tip@sequence\pgfutil@empty%
+ \else%
+ \pgf@worrytrue% Yes, worry if we have to draw an arrow
+ \fi%
\pgf@precise@shorteningfalse%
\pgf@arrow@compute@shortening\pgf@end@tip@sequence%
\advance\pgf@xa by\pgf@shorten@end@additional%
@@ -317,28 +335,28 @@
\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
- %
+ %
+ % 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%
@@ -376,7 +394,7 @@
\def\pgfpointlastonpath{\pgfqpoint{#5}{#6}}%
\let\pgfpointfourthlastonpath\relax%
\let\pgfpointthirdlastonpath\relax%
- \let\pgf@next\pgf@parse@end@gobble@three%
+ \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%
@@ -394,8 +412,8 @@
\fi%
}
-%
-% Preps
+%
+% Preps
%
\def\pgf@prep@movetoend{%
\pgf@process{\pgfpointlastonpath}%
@@ -422,7 +440,7 @@
}
-%
+%
% Line shortening for straight lines:
%
\def\pgf@do@shorten@straightend{%
@@ -433,21 +451,21 @@
}
-%
+%
% 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%
\fi%
}
-%
+%
% Draw an end arrow at the end of a straight line
-%
+%
\def\pgf@do@draw@straightend{%
{%
\pgftransformreset%
@@ -458,29 +476,31 @@
-%
-%
-% Handling the start of a path
-%
-%
+
+
+%
+%
+% 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
+% (step 0) and, if so, split the path (step 1) if necessary, 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).
+% \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?
- %
+ %
+ % 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
@@ -491,30 +511,30 @@
\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%
@@ -549,7 +569,7 @@
\let\pgf@prep@start\pgf@prep@straightstart%
\fi%
\else% A straight line -> great!
- \let\pgf@next\pgf@parse@start@till@stop%
+ \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%
@@ -571,8 +591,8 @@
\def\pgfsubpathend{#1{#2}{#3}#4{#5}{#6}#7}%
}
-%
-% Preps
+%
+% Preps
%
\def\pgf@prep@movetostart{%
\pgf@process{\pgfpointfirstonpath}%
@@ -598,7 +618,7 @@
\pgf@ya\pgf@y%
}
-%
+%
% Line shortening for straight lines:
%
\def\pgf@do@shorten@straightstart{%
@@ -609,21 +629,21 @@
}
-%
+%
% 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%
\fi%
}
-%
+%
% Draw an start arrow at the start of a straight line
-%
+%
\def\pgf@do@draw@straightstart{%
{%
\pgftransformreset%
@@ -639,8 +659,3 @@
\endinput%
-
-
-
-
-