summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
committerKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
commitacab24042d34dd439e1d074820d1da2fa1d591cd (patch)
tree32881f869e20a69711c5fe86134aa48143d9b1e8 /Master/texmf-dist/tex/generic/pgf/basiclayer
parent93f5c4643a3d0a596d220ff14756ce68d99afe33 (diff)
pgf (4apr19)
git-svn-id: svn://tug.org/texlive/trunk@50758 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/pgfcoreexternal.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex87
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex1
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex173
4 files changed, 123 insertions, 140 deletions
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 8e150972a97..9ec63ff7c66 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
@@ -273,7 +273,7 @@
% \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).
+% \if@filesw is \iftrue).
%
%
% #1: the image file name (such that #1.dpth exists)
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 57db0d20ba2..028546dde89 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
@@ -568,8 +568,8 @@
%
% #1 = a time
% #2 = center of a ellipse
-% #3 = 0-degree exis of the ellipse
-% #4 = 90-degree exis of the ellipse
+% #3 = 0-degree axis of the ellipse
+% #4 = 90-degree axis of the ellipse
% #5 = start angle of an arc on the ellipse
% #6 = end angle of an arc on the ellipse
%
@@ -851,11 +851,11 @@
\def\pgfpointxyz#1#2#3{%
\pgfmathparse{#1}%
- \let\pgftemp@x=\pgfmathresult%
+ \global\let\pgftemp@x=\pgfmathresult%
\pgfmathparse{#2}%
- \let\pgftemp@y=\pgfmathresult%
+ \global\let\pgftemp@y=\pgfmathresult%
\pgfmathparse{#3}%
- \let\pgftemp@z=\pgfmathresult%
+ \global\let\pgftemp@z=\pgfmathresult%
\global\pgf@x=\pgftemp@x\pgf@xx%
\global\advance\pgf@x by \pgftemp@y\pgf@yx%
\global\advance\pgf@x by \pgftemp@z\pgf@zx%
@@ -943,77 +943,12 @@
\def\pgfpointnormalised#1{%
\pgf@process{#1}%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
- \ifdim\pgf@x<0pt\relax% move into first quadrant
- \global\pgf@x=-\pgf@x%
- \fi%
- \ifdim\pgf@y<0pt\relax%
- \pgf@y=-\pgf@y%
- \fi%
- \ifdim\pgf@x>\pgf@y% x > y
- % make point small
- \c@pgf@counta=\pgf@x%
- \divide\c@pgf@counta by 65536\relax%
- \ifnum\c@pgf@counta=0\relax%
- \c@pgf@counta=1\relax%
- \fi%
- \global\divide\pgf@x by\c@pgf@counta%
- \global\divide\pgf@y by\c@pgf@counta%
- \divide\pgf@xa by\c@pgf@counta%
- \divide\pgf@ya by\c@pgf@counta%
- % ok.
- \global\pgf@x=.125\pgf@x%
- \global\pgf@y=.125\pgf@y%
- \c@pgf@counta=\pgf@x%
- \c@pgf@countb=\pgf@y%
- \multiply\c@pgf@countb by 100%
- \ifnum\c@pgf@counta<64\relax%
- \global\pgf@x=1pt\relax%
- \global\pgf@y=0pt\relax%
- \else%
- \divide\c@pgf@countb by \c@pgf@counta%
- \global\pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
- \pgf@xc=8192pt%
- \divide\pgf@xc by\c@pgf@counta%
- \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya%
- \global\pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y%
- \fi%
- \ifdim\pgf@xa<0pt%
- \global\pgf@x=-\pgf@x%
- \fi%
- \else% x <= y
- % make point small
- \c@pgf@counta=\pgf@y%
- \divide\c@pgf@counta by 65536\relax%
- \ifnum\c@pgf@counta=0\relax%
- \c@pgf@counta=1\relax%
- \fi%
- \global\divide\pgf@x by\c@pgf@counta%
- \global\divide\pgf@y by\c@pgf@counta%
- \divide\pgf@xa by\c@pgf@counta%
- \divide\pgf@ya by\c@pgf@counta%
- % ok.
- \global\pgf@x=.125\pgf@x%
- \global\pgf@y=.125\pgf@y%
- \c@pgf@counta=\pgf@y%
- \c@pgf@countb=\pgf@x%
- \multiply\c@pgf@countb by 100%
- \ifnum\c@pgf@counta<64\relax%
- \global\pgf@y=1pt\relax%
- \global\pgf@x=0pt\relax%
- \else%
- \divide\c@pgf@countb by \c@pgf@counta%
- \global\pgf@y=\csname pgfmath@cosfrac@\the\c@pgf@countb\endcsname pt%
- \pgf@xc=8192pt%
- \divide\pgf@xc by\c@pgf@counta%
- \global\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa%
- \global\pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x%
- \fi%
- \ifdim\pgf@ya<0pt%
- \global\pgf@y=-\pgf@y%
- \fi%
- \fi\ignorespaces%
+ \pgfmathatantwo{\the\pgf@y}{\the\pgf@x}%
+ \let\pgf@tmp=\pgfmathresult%
+ \pgfmathcos@{\pgf@tmp}%
+ \pgf@x=\pgfmathresult pt\relax%
+ \pgfmathsin@{\pgf@tmp}%
+ \pgf@y=\pgfmathresult pt\relax%
}
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 50a820f6126..3e292aa0383 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
@@ -742,6 +742,7 @@
\def\pgfinterruptpicture
{%
\begingroup%
+ \csname tikz@inside@picturefalse\endcsname%
\pgfinterruptboundingbox%
\pgftransformreset%
\pgfinterruptpath%
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 971752304a7..93079024f6e 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
@@ -157,6 +157,12 @@
+\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.
@@ -196,8 +202,11 @@
\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%
@@ -226,8 +235,11 @@
\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%
@@ -269,8 +281,11 @@
\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%
@@ -317,7 +332,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 advanterous, of
+% only *if you know what you are doing* (or if you are adventurous, of
% course).
%
% As for other shadings, the optional dependencies argument is used to
@@ -376,17 +391,21 @@
\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{%
@@ -426,38 +445,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}%
+ {}%
{%
- \pgfutil@globalcolorsfalse%
- \def\pgf@shade@adds{}%
- \pgfutil@ifundefined{pgf@deps\pgf@shadingname}%
- {}%
- {%
+ \begingroup
+ \pgfutil@globalcolorsfalse
\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}%
- \xdef\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}%
+ \edef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}%
}%
- }%
- \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}%
+ \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
}%
+ {}%
+ \pgf@invokeshading{\csname\pgf@shadingxname\endcsname}%
}%
}
@@ -484,6 +503,8 @@
\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%
@@ -539,40 +560,66 @@
\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:
- \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%
+ % 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%
\fi%
\endgroup%
\fi%