diff options
author | Karl Berry <karl@freefriends.org> | 2015-08-08 22:54:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-08-08 22:54:29 +0000 |
commit | 531d43fafa269c546d587eaca6cd14adcd11914f (patch) | |
tree | 1883933af984c60254e6d9d1bd955a76748cb827 /Master/texmf-dist/tex/generic/pgf/basiclayer | |
parent | 877e963d44f039783cb9227d90c911866c780961 (diff) |
pgf (8aug15)
git-svn-id: svn://tug.org/texlive/trunk@38079 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer')
6 files changed, 111 insertions, 39 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 d0fdab957aa..887e86e00e7 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.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/pgfcorearrows.code.tex,v 1.40 2013/11/07 15:45:46 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.43 2015/05/14 14:43:05 cfeuersaenger Exp $ @@ -575,8 +575,9 @@ } \def\pgfarrows@angle@setup@prime#1{% - \pgf@yc#1 pt% - \pgfmathtan@{.5\pgf@yc}% + \pgf@yc#1 pt % + \pgf@yc=0.5\pgf@yc + \pgfmathtan@{\pgf@sys@tonumber\pgf@yc}% \pgfarrowwidth\pgfmathresult\pgfarrowlength% \pgfarrowwidth2\pgfarrowwidth% } @@ -871,15 +872,26 @@ \expandafter\pgftransformxshift\expandafter{\the\pgf@xc}% } +\def\pgf@arrows@color@setup@restore@std@colors{% + % we want to allow 'arrows={fill=pgffillcolor}'. To this end, we have to ensure that \string\color@pgffillcolor is known. + % we can safely keep the macro in the current TeX group since it has global character anyway. + % + % Note that declaring \string\color@pgfstrokecolor as \global macro causes save stack issues and should be avoided. + \pgfutil@namelet{\string\color@pgfstrokecolor}{pgf@strokecolor@global}% + \pgfutil@namelet{\string\color@pgffillcolor}{pgf@fillcolor@global}% + % +}% + \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% + \ifx\pgf@strokecolor@global\pgf@fillcolor@global \else + \pgf@arrows@color@setup@restore@std@colors \pgfsetfillcolor{pgfstrokecolor}% \fi% \else% + \pgf@arrows@color@setup@restore@std@colors \pgfsetfillcolor{\pgf@arrows@fill@color}% \fi% } 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 75789f2d16c..31fa80f3635 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.20 2013/07/15 12:05:31 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.21 2014/07/09 14:01:22 cfeuersaenger Exp $ @@ -492,7 +492,7 @@ \immediate\closeout\pgf@plotwrite \fi \fi - \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}% + \pgfsys@prepare@papersize{\the\wd\pgfpic}{\the\dimen0}% % \setbox0=\vbox{% % I admit that I don't know why there is this kerning: 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 81b39f34659..a0a7ac9651e 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.11 2013/09/19 22:34:34 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.12 2014/11/02 21:38:01 cfeuersaenger Exp $ % Globals @@ -125,9 +125,10 @@ \def\pgfsetstrokecolor#1{% \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% + \expandafter\let\expandafter\pgf@temp\csname\string\color@pgfstrokecolor\endcsname + % for arrow tips: + \global\let\pgf@strokecolor@global=\pgf@temp + \expandafter\pgf@setstrokecolor\pgf@temp% } \def\pgf@setstrokecolor#1#2#3#4#5{% \expandafter\ifx\csname pgfsys@color@#4@stroke\endcsname\relax% @@ -159,9 +160,10 @@ \def\pgfsetfillcolor#1{% \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% + \expandafter\let\expandafter\pgf@temp\csname\string\color@pgffillcolor\endcsname + % for arrow tips: + \global\let\pgf@fillcolor@global=\pgf@temp + \expandafter\pgf@setfillcolor\pgf@temp } \def\pgf@setfillcolor#1#2#3#4#5{% \expandafter\ifx\csname pgfsys@color@#4@fill\endcsname\relax% @@ -183,11 +185,11 @@ \def\pgfsetcolor#1{% \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% + \expandafter\let\expandafter\pgf@temp\csname\string\color@pgfstrokecolor\endcsname + % for arrow tips: + \global\let\pgf@strokecolor@global=\pgf@temp + \global\let\pgf@fillcolor@global=\pgf@temp + \expandafter\pgf@setcolor\pgf@temp% } \def\pgf@setcolor#1#2#3#4#5{% \expandafter\ifx\csname pgfsys@color@#4\endcsname\relax% 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 e60f66cce2f..0c36d3c1a4f 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.23 2013/12/13 15:11:58 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.24 2014/11/02 21:38:01 cfeuersaenger Exp $ % Stroke/fill/clip/etc. the current path. Depending on the options, @@ -236,7 +236,7 @@ \def\pgf@stroke@inner@line@if@needed{% \ifdim\pgfinnerlinewidth>0pt\relax% - \expandafter\let\expandafter\pgf@temp@save\csname\string\color@pgfstrokecolor\endcsname% + \let\pgf@temp@save=\pgf@strokecolor@global \pgfsys@beginscope% {% \pgfsys@setlinewidth{\pgfinnerlinewidth}% @@ -245,7 +245,7 @@ \pgfsys@stroke% }% \pgfsys@endscope% - \expandafter\global\expandafter\let\csname\string\color@pgfstrokecolor\endcsname\pgf@temp@save% + \global\let\pgf@strokecolor@global=\pgf@temp@save \fi% } 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 406d52e3a22..02687fc29c3 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.44 2013/10/09 18:30:27 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.46 2015/05/08 10:23:50 tantau Exp $ % Globals @@ -50,14 +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% + \let\pgfscope@stroke@color=\pgf@strokecolor@global% + \let\pgfscope@fill@color=\pgf@fillcolor@global% \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% + \global\let\pgf@strokecolor@global=\pgfscope@stroke@color% + \global\let\pgf@fillcolor@global=\pgfscope@fill@color% \pgfsys@endscope} 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 83f89b1fa2d..5e13c6cb660 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.17 2013/10/10 08:53:09 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.20 2015/08/07 10:17:34 cfeuersaenger Exp $ % Position transformations @@ -58,8 +58,8 @@ % \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#2{\pgf@pt@ab}% attention: this is (1,0), i.e. the point which is usually labelled 'ba'! + \edef#3{\pgf@pt@ba}% attention: this is (0,1), i.e. the point which is usually labelled 'ab'! \edef#4{\pgf@pt@bb}% \edef#5{\the\pgf@pt@x}% \edef#6{\the\pgf@pt@y}% @@ -97,6 +97,8 @@ \def\pgf@idmatrixtext{1.0,0.0,0.0,1.0} \def\pgf@zerozerotext{0.0,0.0} +\def\pgf@one@text{1.0} +\def\pgf@zero@text{0.0} % Transformation command % @@ -317,10 +319,10 @@ \def\pgftransformreset{% \pgf@pt@x=0pt% \pgf@pt@y=0pt% - \def\pgf@pt@aa{1.0}% - \def\pgf@pt@ba{0.0}% - \def\pgf@pt@ab{0.0}% - \def\pgf@pt@bb{1.0}% + \let\pgf@pt@aa\pgf@one@text% + \let\pgf@pt@ba\pgf@zero@text% + \let\pgf@pt@ab\pgf@zero@text% + \let\pgf@pt@bb\pgf@one@text% \pgf@pt@identitytrue% } @@ -332,10 +334,10 @@ % \pgftansformreset \def\pgftransformresetnontranslations{% - \def\pgf@pt@aa{1.0}% - \def\pgf@pt@ba{0.0}% - \def\pgf@pt@ab{0.0}% - \def\pgf@pt@bb{1.0}% + \let\pgf@pt@aa\pgf@one@text% + \let\pgf@pt@ba\pgf@zero@text% + \let\pgf@pt@ab\pgf@zero@text% + \let\pgf@pt@bb\pgf@one@text% \pgf@pt@identitytrue% } @@ -608,6 +610,62 @@ + +% Computes transformations adjustments for the current transformation +% matrix +% +% Description: +% +% This command is used when you install a transformation matrix that +% scales everything by a certain factor, but you still wish to draw +% something with "an absolute size". Suppose for instance that you +% install a transformation matrix that scales everything by a factor +% of 4 and you now wish to draw a horizontal line of length 1cm. Then, +% if you do not reset the transformation matrix, you can draw a line +% of logical length 2.5mm, which will then get scaled to a line of +% 1cm. +% +% Things get more difficult in case you scale things only, say, +% vertically. In this case, the adjustement necessary for horizontal +% lines is different from the one needed for vertical lines. +% +% This function computes the necessary scaling factors and puts them +% in the macros \pgfhorizontaltransformationadjustment and +% \pgfverticaltransformationadjustment. +% +% Note that the "right" way to draw a line of absolute length 1cm in a +% transformed coordinate system is to first compute the start point +% and to then reset the transformation matrix. The transofmration +% adjustments computed here are important only in situations where you +% cannot do this, for instance when an "outer xsep" must be set. + +\def\pgftransformationadjustments{% + \ifpgf@pt@identity% + \let\pgfhorizontaltransformationadjustment\pgf@one@text% + \let\pgfverticaltransformationadjustment\pgf@one@text% + \else% + {% + \pgf@pt@x0pt% + \pgf@pt@y0pt% + \pgfpointtransformed{\pgfqpoint{1pt}{0pt}}% + \pgfmathveclen@{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}% + \pgfmathreciprocal@{\pgfmathresult}% + \global\let\pgf@temp@hori\pgfmathresult + \pgfpointtransformed{\pgfqpoint{0pt}{1pt}}% + \pgfmathveclen@{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}% + \pgfmathreciprocal@{\pgfmathresult}% + \global\let\pgf@temp@vert\pgfmathresult + \xdef\pgf@marshal@b{\def\noexpand\pgfverticaltransformationadjustment{\pgfmathresult}} + }% + \let\pgfhorizontaltransformationadjustment\pgf@temp@hori% + \let\pgfverticaltransformationadjustment\pgf@temp@vert% + \fi% +} + +\let\pgfhorizontaltransformationadjustment\pgf@one@text +\let\pgfverticaltransformationadjustment\pgf@one@text + + % Low-level transformations % Causes the current high-level transformation command to be applied @@ -675,7 +733,7 @@ \let\pgfapproximatenonlineartranslation\relax \let\pgfapproximatenonlineartransformation\relax \def\pgftransformnonlinear#1{\pgferror{You need to say - \string\usepgfmodule{nonlineartransformation} to use nonlinear transformations}} + \string\usepgfmodule{nonlineartransformations} to use nonlinear transformations}} \endinput |