summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex173
1 files changed, 63 insertions, 110 deletions
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 93079024f6e..971752304a7 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
@@ -157,12 +157,6 @@
-\newcount\pgf@shadingcount
-\pgf@shadingcount=0
-{
- \catcode`\%=12
- \gdef\pgf@shadingnum{%\the\pgf@shadingcount%}
-}
% Declares a horizontal shading for later use. The shading is a
% horizontal bar that changes its color.
@@ -202,11 +196,8 @@
\def\pgf@declarehorizontalshading[#1]#2#3#4{%
\expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}%
\expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty%
- \expandafter\let\csname pgf@num@pgfshading#2!\endcsname\pgfutil@empty
\pgfsys@horishading{#2}{#3}{#4}%
\else%
- \global\advance\pgf@shadingcount 1\relax
- \expandafter\edef\csname pgf@num@pgfshading#2!\endcsname{\pgf@shadingnum}%
\expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@horishading}%
\expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}%
\expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty%
@@ -235,11 +226,8 @@
\def\pgf@declareverticalshading[#1]#2#3#4{%
\expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}%
\expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty%
- \expandafter\let\csname pgf@num@pgfshading#2!\endcsname=\pgfutil@empty
\pgfsys@vertshading{#2}{#3}{#4}%
\else%
- \global\advance\pgf@shadingcount 1\relax
- \expandafter\edef\csname pgf@num@pgfshading#2!\endcsname{\pgf@shadingnum}%
\expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@vertshading}%
\expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}%
\expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty%
@@ -281,11 +269,8 @@
\def\pgf@declareradialshading[#1]#2#3#4{%
\expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}%
\expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty%
- \expandafter\let\csname pgf@num@pgfshading#2!\endcsname=\pgfutil@empty
\pgfsys@radialshading{#2}{#3}{#4}%
\else%
- \global\advance\pgf@shadingcount 1\relax
- \expandafter\edef\csname pgf@num@pgfshading#2!\endcsname{\pgf@shadingnum}%
\expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@radialshading}%
\expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}%
\expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty%
@@ -332,7 +317,7 @@
% evaluated for each pixel independently.
%
% Because of the rather difficult PostScript syntax, use this macro
-% only *if you know what you are doing* (or if you are adventurous, of
+% only *if you know what you are doing* (or if you are advanterous, of
% course).
%
% As for other shadings, the optional dependencies argument is used to
@@ -391,21 +376,17 @@
\def\pgf@declarefunctionalshading[#1]#2#3#4#5#6{%
\expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}%
\expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty%
- \expandafter\let\csname pgf@num@pgfshading#2!\endcsname=\pgfutil@empty
\pgfshade@functionaldo{#2}{#3}{#4}{#5}{#6}%
\else%
- \global\advance\pgf@shadingcount 1\relax
- \expandafter\edef\csname pgf@num@pgfshading#2!\endcsname{\pgf@shadingnum}%
\expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfshade@functionaldo}%
\expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}{#5}{#6}}%
\expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty%
\fi}
\def\pgfshade@functionaldo#1#2#3#4#5{%
- \begingroup
+ {%
#4%
\pgfsys@functionalshading{#1}{#2}{#3}{#5}%
- \expandafter\pgfmath@smuggleone\csname @pgfshading#1!\endcsname
- \endgroup
+ }%
}
\def\pgfshadecolortorgb#1#2{%
@@ -445,38 +426,38 @@
\expandafter\pgfutil@ifundefined\expandafter{\pgf@shadingname}%
{\pgferror{Undefined shading "#1"}}%
{%
- \edef\pgf@shade@adds{\csname pgf@num\pgf@shadingname\endcsname}%
- \pgfutil@ifundefined{pgf@deps\pgf@shadingname}%
- {}%
{%
- \begingroup
- \pgfutil@globalcolorsfalse
+ \pgfutil@globalcolorsfalse%
+ \def\pgf@shade@adds{}%
+ \pgfutil@ifundefined{pgf@deps\pgf@shadingname}%
+ {}%
+ {%
\edef\@list{\csname pgf@deps\pgf@shadingname\endcsname}%
\pgfutil@for\@temp:=\@list\do{%
- \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}%
- \pgfutil@extractcolorspec{\@temp}{\pgf@tempcolor}%
- \expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}%
- \edef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}%
+ {%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}%
+ \pgfutil@extractcolorspec{\@temp}{\pgf@tempcolor}%
+ \expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}%
+ \xdef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}%
+ }%
}%
- \pgfmath@smuggleone\pgf@shade@adds
- \endgroup
- }%
- \expandafter\pgf@strip@shadename\pgf@shadingname!!%
- \edef\pgf@shadingxname{@pgfshading\pgf@basename\pgf@shade@adds!}%
- \pgfutil@ifundefined{\pgf@shadingxname}%
- {%
- \begingroup
- \edef\@temp{\expandafter\noexpand\csname pgf@func\pgf@shadingname\endcsname}%
- \edef\@args{{\pgf@basename\pgf@shade@adds}}%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\@@args
- \expandafter\expandafter\expandafter{\csname pgf@args\pgf@shadingname\endcsname}%
- \expandafter\expandafter\expandafter\@temp\expandafter\@args\@@args
- \expandafter\pgfmath@smuggleone\csname\pgf@shadingxname\endcsname
- \endgroup
+ }%
+ \expandafter\pgf@strip@shadename\pgf@shadingname!!%
+ \pgfutil@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}%
+ {%
+ {%
+ \expandafter\def\expandafter\@temp\expandafter{\csname pgf@func\pgf@shadingname\endcsname}%
+ \edef\@args{{\pgf@basename\pgf@shade@adds}}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\@@args%
+ \expandafter\expandafter\expandafter{\csname pgf@args\pgf@shadingname\endcsname}%
+ \expandafter\expandafter\expandafter\@temp\expandafter\@args\@@args%
+ %
+ }%
+ }%
+ {}%
+ \pgf@invokeshading{\csname @pgfshading\pgf@basename\pgf@shade@adds!\endcsname}%
}%
- {}%
- \pgf@invokeshading{\csname\pgf@shadingxname\endcsname}%
}%
}
@@ -503,8 +484,6 @@
\def\pgfaliasshading#1#2{%
\expandafter\let\expandafter\pgf@temp\expandafter=\csname @pgfshading#2!\endcsname%
\expandafter\let\csname @pgfshading#1!\endcsname=\pgf@temp%
- \expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@num@pgfshading#2!\endcsname%
- \expandafter\let\csname pgf@num@pgfshading#1!\endcsname=\pgf@temp%
\expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@deps@pgfshading#2!\endcsname%
\expandafter\let\csname pgf@deps@pgfshading#1!\endcsname=\pgf@temp%
\expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@func@pgfshading#2!\endcsname%
@@ -560,66 +539,40 @@
\advance\pgf@xb by.5\pgf@pathminx%
\pgf@yb=.5\pgf@pathmaxy%
\advance\pgf@yb by.5\pgf@pathminy%
- % Calculate rotation:
- \pgfmathparse{#2}%
- \let\pgfshade@angle=\pgfmathresult
- \pgfmathsin@\pgfshade@angle
- \let\pgfshade@sin=\pgfmathresult
- \pgfmathcos@\pgfshade@angle
- \let\pgfshade@cos=\pgfmathresult
- % width and height of the bounding box
- \pgf@xa=\pgf@pathmaxx
- \advance\pgf@xa by-\pgf@pathminx
- \pgf@ya=\pgf@pathmaxy
- \advance\pgf@ya by-\pgf@pathminy
% Calculate scaling:
- % xscale = 1pt/50bp * (w*|cos(a)|+h*|sin(a)|)/(|cos(a)|+|sin(a)|)
- % yscale = 1pt/50bp * (w*|sin(a)|+h*|cos(a)|)/(|cos(a)|+|sin(a)|)
- % 1pt/50bp = .01992528
- \pgfmathabs@\pgfshade@sin
- \let\pgfshade@abssin=\pgfmathresult
- \pgfmathabs@\pgfshade@cos
- \let\pgfshade@abscos=\pgfmathresult
- \pgf@xc=\pgfshade@abscos\pgf@xa
- \advance\pgf@xc by\pgfshade@abssin\pgf@ya
- \pgf@yc=\pgfshade@abssin\pgf@xa
- \advance\pgf@yc by\pgfshade@abscos\pgf@ya
- \pgfmathadd@\pgfshade@abscos\pgfshade@abssin
- \pgfmathdivide@{.01992528}{\pgfmathresult}%
- \pgf@xc=\pgfmathresult\pgf@xc
- \pgf@yc=\pgfmathresult\pgf@yc
- \ifdim\pgf@xc<0.0001pt
- \ifdim\pgf@xc>-0.0001pt
- \pgf@no@shadetrue
- \fi
- \fi
- \ifdim\pgf@yc<0.0001pt
- \ifdim\pgf@yc>-0.0001pt
- \pgf@no@shadetrue
- \fi
- \fi
- \ifpgf@no@shade\else
- \pgfsys@beginscope
- \pgfsyssoftpath@invokecurrentpath
- \pgfsys@clipnext
- \pgfsys@discardpath
- % Compute new transformation matrix:
- % shift
- \pgfsys@transformcm{1}{0}{0}{1}{\the\pgf@xb}{\the\pgf@yb}%
- % rotation
- \pgf@x=\pgfshade@sin pt%
- \pgf@xa=-\pgf@x%
- \pgfsys@transformcm{\pgfshade@cos}{\pgfshade@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgfshade@cos}{0pt}{0pt}%
- % scaling
- \pgfsys@transformcm{\pgf@sys@tonumber{\pgf@xc}}{0}{0}{\pgf@sys@tonumber{\pgf@yc}}{0pt}{0pt}%
- % This will actually be the first transformation of the shading.
- % Should it be applied first so that it becomes the last one?
- \ifx\pgf@shade@extra@transform\pgfutil@empty%
- \else%
- \pgflowlevel{\pgf@shade@extra@transform}%
- \fi%
- \pgfuseshading{#1}%
- \pgfsys@endscope%
+ \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%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@clipnext%
+ \pgfsys@discardpath%
+ % Compute new transformation matrix:
+ \pgfsys@transformcm{1}{0}{0}{1}{\pgf@xb}{\pgf@yb}%
+ \pgfsys@transformcm%
+ {\pgf@sys@tonumber{\pgf@xc}}{0}%
+ {0}{\pgf@sys@tonumber{\pgf@yc}}{0pt}{0pt}%
+ \pgfmathparse{#2}%
+ \let\pgfshade@angle=\pgfmathresult%
+ \pgfmathsin@{\pgfshade@angle}%
+ \let\pgfshade@sin=\pgfmathresult%
+ \pgfmathcos@{\pgfshade@angle}%
+ \let\pgfshade@cos=\pgfmathresult%
+ \pgf@x=\pgfshade@sin pt%
+ \pgf@xa=-\pgf@x%
+ \pgfsys@transformcm{\pgfshade@cos}{\pgfshade@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgfshade@cos}{0pt}{0pt}%
+ \ifx\pgf@shade@extra@transform\pgfutil@empty%
+ \else%
+ \pgflowlevel{\pgf@shade@extra@transform}%
+ \fi%
+ \pgfuseshading{#1}%
+ \pgfsys@endscope%
\fi%
\endgroup%
\fi%