summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-12 20:45:15 +0000
committerKarl Berry <karl@freefriends.org>2019-07-12 20:45:15 +0000
commitaebf7cb9eaabd4c0092643c77009a567ede155dc (patch)
treefa4aae570987002e252dd9c3d3b96b7571f03848 /Master/texmf-dist/tex/generic/pgf
parent2d83a76b7d0fa40bf7b1c90280ee3388258a73f3 (diff)
pgf (12jul19)
git-svn-id: svn://tug.org/texlive/trunk@51626 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex70
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua33
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex24
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex443
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex43
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex9
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex1
-rw-r--r--Master/texmf-dist/tex/generic/pgf/pgf.revision.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def11
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def50
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def19
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def59
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def59
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def5
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def5
28 files changed, 571 insertions, 356 deletions
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 d2186d66bc2..cda5b1db3fa 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
@@ -123,6 +123,7 @@
\expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{3}%
}
+\def\pgfsys@patternmatrix{{1.0}{0.0}{0.0}{1.0}{0.0pt}{0.0pt}}
\def\pgf@declarepattern#1#2#3#4#5#6{%
\pgfutil@ifundefined{pgf@pattern@name@#1}{%
\pgfsysprotocol@getcurrentprotocol\pgf@pattern@temp%
@@ -156,8 +157,11 @@
\expandafter\xdef\csname pgf@pattern@name@#1\endcsname{\the\pgfutil@tempcnta}%
\expandafter\gdef\csname pgf@pattern@type@#1\endcsname{#6}%
\xdef\pgf@marshal{\noexpand\pgfsys@declarepattern
- {\csname pgf@pattern@name@#1\endcsname}
- {\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}{\pgf@pattern@code}{#6}}%
+ {\csname pgf@pattern@name@#1\endcsname}% name
+ {\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}% bbox
+ {\the\pgf@xc}{\the\pgf@yc}% x/y step
+ \pgfsys@patternmatrix% transformation matrix
+ {\pgf@pattern@code}{#6}}%
}%
\pgfsysprotocol@setcurrentprotocol\pgf@pattern@temp%
\expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\pgf@marshal%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
index 3b52136f708..4327768186c 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
@@ -45,7 +45,7 @@
\let\tikz@transform=\relax\pgfkeys{/tikz/.cd,#1}}%
},
infer tile bounding box/.code={
- \def\pgf@pat@codeafterhook{%
+ \def\pgf@pat@codeafter{%
\xdef\tikz@pat@installbb{%
\noexpand\pgfkeys{/tikz/patterns/bounding box={%
(\the\pgf@picminx-#1,\the\pgf@picminy-#1) and
@@ -62,13 +62,13 @@
\def\tikzdeclarepattern#1{%
\begingroup%
- \def\pgf@pat@codebeforehook{%
+ \def\pgf@pat@codebefore{%
\let\tikz@transform=\relax%
\pgftransformreset% <- Hmm?
\tikz@declarepattern@install%
\ifnum\pgf@pat@type=0\relax%
- \let\pgfsetstrokecolor=\tikz@pat@gobbleone%
- \let\pgfsetfillcolor=\tikz@pat@gobbleone%
+ \let\pgfsetstrokecolor=\pgfutil@gobble%
+ \let\pgfsetfillcolor=\pgfutil@gobble%
\fi%
\def\tikz@fig{%
\tikzerror{You cannot use nodes inside a pattern}%
@@ -76,7 +76,7 @@
\tikzset{pattern/.code={\tikzerror{You cannot nest patterns}},
pattern color/.style={pattern}}%
}%
- \pgfdeclarepattern{/tikz/patterns/.cd, #1}%
+ \pgfdeclarepattern{/tikz/patterns/.cd,#1}%
\endgroup%
}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
index b719271d57e..2051fce8fd6 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
@@ -34,9 +34,7 @@
\pgfmathsetmacro\tikz@to@bend{#1}%
\fi%
\let\tikz@to@out=\tikz@to@bend%
- \c@pgf@counta=180\relax%
- \advance\c@pgf@counta by-\tikz@to@out\relax%
- \edef\tikz@to@in{\the\c@pgf@counta}%
+ \pgfmathsetmacro\tikz@to@in{180-\tikz@to@out}%
\tikz@to@switch@on%
\tikz@to@relativetrue%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
index 090155e26d0..5f67167ad37 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
@@ -20,6 +20,8 @@
\newdimen\tikz@lasty
\newdimen\tikz@lastxsaved
\newdimen\tikz@lastysaved
+\newdimen\tikz@lastmovetox
+\newdimen\tikz@lastmovetoy
\newdimen\tikzleveldistance
\newdimen\tikzsiblingdistance
@@ -146,6 +148,42 @@
\expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
\pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashon}}%
+% use a decoration to expand the `off' section of a dash pattern.
+% https://tex.stackexchange.com/a/133357
+\tikzset{
+ dash expand off/.code={%
+ \ifcsname tikz@library@decorations@loaded\endcsname\else
+ \tikzerror{You need \string\usetikzlibrary{decorations} for ``dash offexpand''}%
+ \fi
+ \tikz@addoption{%
+ \pgfgetpath\currentpath
+ \pgfprocessround{\currentpath}{\currentpath}%
+ \pgf@decorate@parsesoftpath{\currentpath}{\currentpath}%
+ % Parse \on and \off from the current path
+ \edef\on{\expandafter\pgfutil@firstoftwo\tikz@dashpattern}%
+ \edef\off{\expandafter\pgfutil@secondoftwo\tikz@dashpattern}%
+ % \dashphase = max(\on - \dashphase, 0)
+ \pgfmathsubtract@{\on}{\tikz@dashphase}%
+ \pgfmathmax@{\pgfmathresult}{0}%
+ \edef\dashphase{\the\dimexpr\pgfmathresult pt\relax}%
+ % \rest = \pgf@decorate@totalpathlength - \on
+ \edef\rest{\expandafter\pgf@sys@tonumber\dimexpr\pgf@decorate@totalpathlength - \on + 2\dimexpr\dashphase\relax\relax}%
+ % \onoff = \on + \off
+ \edef\onoff{\expandafter\pgf@sys@tonumber\dimexpr\on+\off\relax}%
+ % \nfullonoff = max(floor(\rest/\onoff), 1)
+ \pgfmathdivide@{\rest}{\onoff}%
+ \pgfmathfloor@{\pgfmathresult}%
+ \pgfmathmax@{\pgfmathresult}{1}%
+ % \offexpand = max(\rest/\nfullonoff - \on, \off)
+ \pgfmathdivide@{\rest}{\pgfmathresult}%
+ \pgfmathsubtract@{\pgfmathresult}{\on}%
+ \pgfmathmax@{\pgfmathresult}{\off}%
+ \edef\tikz@marshal{\noexpand\pgfsetdash{{\on}{\pgfmathresult}}{\dashphase}}%
+ \tikz@marshal
+ }%
+ }
+}
+
\tikzoption{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}}%
% Double draw options
@@ -1584,6 +1622,7 @@
% ID callbacks
\newif\iftikz@is@node
+\let\tikz@id@name\pgfutil@empty
\let\tikz@id@hook\pgfutil@empty
\def\tikz@call@id@hook{\ifx\tikz@id@hook\pgfutil@empty\else\tikz@id@hook\pgfuseid{\tikz@id@name}\fi}%
@@ -2673,24 +2712,38 @@
\def\tikz@moveto{%
\tikz@scan@one@point{\tikz@@moveto}}%
\def\tikz@@moveto#1{%
- \tikz@make@last@position{#1}%
+ \tikz@make@last@position{#1}%
\iftikz@shapeborder%
% ok, the moveto will have to wait. flag that we have a moveto in
% waiting:
\edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
\else%
- \pgfpathmoveto{\tikz@last@position}%
+ \tikz@@movetosave{\tikz@last@position}%
\let\tikz@moveto@waiting=\relax%
\fi%
\tikz@scan@next@command%
}%
+ % Wrapper around \pgfpathmoveto that adds a save
+\def\tikz@@movetosave#1{%
+ {\pgftransformreset
+ \pgf@process{#1}%
+ \xdef\tikz@marshal{%
+ \tikz@lastmovetox=\the\pgf@x\relax%
+ \tikz@lastmovetoy=\the\pgf@y\relax%
+ }%
+ }%
+ \tikz@marshal
+ \pgfpathmoveto{#1}%
+}%
+
+
\let\tikz@moveto@waiting=\relax % normally, nothing is waiting...
\def\tikz@flush@moveto{%
\ifx\tikz@moveto@waiting\relax%
\else%
- \pgfpathmoveto{\tikz@last@position}%
+ \tikz@@movetosave{\tikz@last@position}%
\fi%
\let\tikz@moveto@waiting=\relax%
}%
@@ -2707,7 +2760,7 @@
#2=\pgf@x%
#3=\pgf@y%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
- \pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \tikz@@movetosave{\pgfqpoint{\pgf@x}{\pgf@y}}%
\fi%
\let\tikz@moveto@waiting=\relax%
}%
@@ -2954,7 +3007,8 @@
\tikz@make@last@position{\expandafter\pgfpoint\pgfsyssoftpath@lastmoveto}%
\tikz@path@close{\expandafter\pgfpoint\pgfsyssoftpath@lastmoveto}%
\def\pgfstrokehook{}%
- \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \edef\tikz@timer@end{%\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+ \noexpand\pgfqpoint{\the\tikz@lastmovetox}{\the\tikz@lastmovetoy}}%
\let\tikz@timer=\tikz@timer@line%
\let\tikz@tangent\tikz@timer@start%
\tikz@scan@next@command%
@@ -3226,7 +3280,7 @@
\else%
\pgf@process{\pgfpointshapeborder{\tikz@moveto@waiting}{\tikz@curve@first}}%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
- \pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
+ \tikz@@movetosave{\pgfqpoint{\pgf@x}{\pgf@y}}%
\fi%
\let\tikz@timer@cont@one=\tikz@curve@first%
\let\tikz@timer@cont@two=\tikz@curve@second%
@@ -3271,7 +3325,7 @@
\tikz@make@last@position{#1}%
\edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
\let\tikz@timer=\tikz@timer@line%
- \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \tikz@@movetosave{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\tikz@path@lineto{\pgfqpoint{\pgf@xa}{\tikz@lasty}}%
\tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
\tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@ya}}%
@@ -3279,7 +3333,7 @@
\tikz@path@lineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\fi%
\pgfpathclose%
- \pgfpathmoveto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
+ \tikz@@movetosave{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
\def\pgfstrokehook{}%
\let\tikz@tangent\relax%
\tikz@scan@next@command%
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
index 51e278b904c..86b65abc83e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
@@ -306,39 +306,6 @@ function SpringHu2006:computeForceLayout(graph, spring_length, step_update_func)
-- update the energy function
energy = energy + math.pow(d:norm(), 2)
- -- vector for the displacement of v
- local d = Vector.new(2)
-
- for _,u in ipairs(graph.nodes) do
- if v ~= u then
- -- compute the distance between u and v
- local delta = u.pos:minus(v.pos)
-
- -- enforce a small virtual distance if the nodes are
- -- located at (almost) the same position
- if delta:norm() < 0.1 then
- delta:update(function (n, value) return 0.1 + lib.random() * 0.1 end)
- end
-
- local graph_distance = (distances[u] and distances[u][v]) and distances[u][v] or #graph.nodes + 1
-
- -- compute the repulsive force vector
- local force = repulsive_force(delta:norm(), graph_distance, v.weight)
- local force = delta:normalized():timesScalar(force)
-
- -- move the node v accordingly
- d = d:plus(force)
- end
- end
-
- -- really move the node now
- -- TODO note how all nodes are moved by the same amount (step_length)
- -- while Walshaw multiplies the normalized force with min(step_length,
- -- d:norm()). could that improve this algorithm even further?
- v.pos = v.pos:plus(d:normalized():timesScalar(step_length))
-
- -- update the energy function
- energy = energy + math.pow(d:norm(), 2)
end
end
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
index 300ba52e989..7a94b6f8fde 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
@@ -299,7 +299,7 @@
\pgfluamath@install@function\pgfmathsubtract@=\pgfluamathsubtract@%
\pgfluamath@install@function\pgfmathneg@=\pgfluamathneg@%
\pgfluamath@install@function\pgfmathmultiply@=\pgfluamathmultiply@%
- \pgfmathfloat@install\pgfmath@iftrue=\pgfmathluamath@iftrue%
+ \pgfluamath@install@function\pgfmath@iftrue=\pgfmathluamath@iftrue%
\pgfluamath@install@function\pgfmathdivide@=\pgfluamathdivide@%
% \pgfluamath@install@function\pgfmathdiv@=\pgfluamathdiv@%
\pgfluamath@install@function\pgfmathfactorial@=\pgfluamathfactorial@%
@@ -406,7 +406,7 @@
\def\pgfluamathadd@#1#2{%
\pgfluamathgetresult{pgfluamathfunctions.add(#1,#2)}}%
\def\pgfluamathsubtract@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.substract(#1,#2)}}%
+ \pgfluamathgetresult{pgfluamathfunctions.subtract(#1,#2)}}%
\def\pgfluamathneg@#1{%
\pgfluamathgetresult{pgfluamathfunctions.neg(#1)}}%
\def\pgfluamathmultiply@#1#2{%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
index 42217aadf30..941704d1767 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
@@ -106,7 +106,7 @@
\pgf@curvilinear@length@a\pgfmathresult pt%
\ifdim\pgf@curvilinear@length@a>1pt\relax%
% Ok, too large, let us make this smaller
- \pgfmathdivide@{\pgf@curvilinear@time@a}{\pgf@curvilinear@length@a}%
+ \pgfmathdivide@{\pgf@sys@tonumber\pgf@curvilinear@time@a}{\pgf@sys@tonumber\pgf@curvilinear@length@a}%
\pgf@curvilinear@time@a\pgfmathresult pt%
\pgf@process{\pgfpointcurveattime{\pgf@curvilinear@time@a}{\pgf@curvilinear@line@a}{\pgf@curvilinear@line@b}{\pgf@curvilinear@line@c}{\pgf@curvilinear@line@d}}
\pgf@xb=-\pgf@x%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
index d976f99205e..cb20507fa04 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
@@ -345,6 +345,7 @@
\let\pgfmath@basic@parse@exponent=\pgfmath@parse@exponent%
\let\pgfmath@basic@stack@push@operand=\pgfmath@stack@push@operand
\pgfmathfloat@install\pgfmath@stack@push@operand=\pgfmathfloat@stack@push@operand
+ \pgfmathfloat@install\pgfmath@parse@operand@quote=\pgfmathfloat@parse@operand@quote
\pgfmathfloat@install\pgfmath@parse@exponent=\pgfmathfloat@parse@float@or@exponent
%
\pgfmathfloat@install\pgfmathparse=\pgfmathfloatparse%
@@ -530,6 +531,14 @@
\pgfmath@parse@@operator%
}%
+\def\pgfmathfloat@parse@operand@quote#1"{%
+ \edef\pgfmathresult{\pgfmath@fpu@stringmarker #1}%
+ \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathresult}%
+ \pgfmath@parse@@operator%
+}
+
+\def\pgfmath@fpu@stringmarker{@@str@@:}%
+
% This extends the functionality of the basic level operand stack: it
% assures every element on the stack is a float.
\def\pgfmathfloat@stack@push@operand#1{%
@@ -541,15 +550,26 @@
}%
#1\relax
}%
+
\def\pgfmathfloat@stack@push@operand@single#1\relax{%
\expandafter\pgfutil@in@\pgfmathfloat@POSTFLAGSCHAR{#1}%
\ifpgfutil@in@
\pgfmath@basic@stack@push@operand{#1}%
\else
- \pgfmathfloatparsenumber{#1}%
- \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathresult}%
+ \expandafter\pgfutil@in@\expandafter{\pgfmath@fpu@stringmarker}{#1}%
+ \ifpgfutil@in@
+ \pgfmathfloat@stack@push@operand@single@str#1\relax
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathresult}%
+ \fi
\fi
}%
+
+\expandafter\def\expandafter\pgfmathfloat@stack@push@operand@single@str\pgfmath@fpu@stringmarker #1\relax{%
+ \pgfmath@basic@stack@push@operand{#1}%
+}%
+
\def\pgfmathfloat@stack@push@operand@GOBBLE#1\relax{}%
\def\pgfmathfloat@stack@push@operand@list#1{%
\expandafter\pgfutil@in@ \pgfmathfloat@POSTFLAGSCHAR{#1}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
index 7de4a2b9e97..6bed3e4721b 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
@@ -48,10 +48,10 @@
% #2: [output] a macro name which will contain the segment index of the first path which contains the solution
% #3: [output] a macro name which will contain the segment index of the second path which contains the solution
%
-% Example: \pgfintersectiongetsolutionsegmentindices{0}{\first}{\second}
+% Example: \pgfintersectiongetsolutionsegmentindices{0}{\first}{\second}%
%
% -> \first may be 0 if point #0 is in the 0'th segment
-% -> \second may be 42 if point #0 is in the 42'th segment
+% -> \second may be 42 if point #0 is in the 42'th segment
%
% The "segment index" is actually close to the "time" of the solution.
% If a solution is at "time" 42.2, it will have segment index 42.
@@ -82,7 +82,7 @@
% #3: [output] a macro name which will contain the time of the second path which contains the solution
% It will never be empty.
%
-% Example: \pgfintersectiongetsolutiontimes{0}{\first}{\second}
+% Example: \pgfintersectiongetsolutiontimes{0}{\first}{\second}%
%
% -> \first may be 0.5 if point #0 is in just in the middle of the path
% -> \second may be 42.8 if point #0 is in the 42'th segment (compare
@@ -195,9 +195,9 @@
%
% However, \pgf@intersect@time@offset and
% \pgf@intersect@time@offset@b are *always* valid. In fact,they
- % resemble a part of the time: it holds
+ % resemble a part of the time: it holds
% 0 <= \pgf@intersect@time@a < 1
- % and \pgf@intersect@time@offset > 0.
+ % and \pgf@intersect@time@offset > 0.
%
% If we have an intersection in segment 42 of path A,
% \pgf@intersect@time@offset will be 42. The time inside of that
@@ -352,8 +352,7 @@
\pgf@iflinesintersect{#1}{#2}{#3}{#4}%
{%
\pgfextract@process\pgf@intersect@solution@candidate{%
- \pgfpointintersectionoflines{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}%
- {\pgfpoint@intersect@start@b}{\pgfpoint@intersect@end@b}%
+ % pgf@x and pgf@y are already assigned by \pgf@iflinesintersect
}%
\pgf@ifsolution@duplicate{\pgf@intersect@solution@candidate}{%
% ah - we a duplicate. Apparently, we have a hit on an
@@ -388,7 +387,8 @@
\pgf@intersection@store@properties{pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions}%
}%
%
- }{}%
+ }{%
+ }%
}%
% Test if two lines L1 and L2 intersect.
@@ -429,95 +429,199 @@
\endgroup%
}%
+% queried by pgfplots. Do not delete, only increase.
+\def\pgf@intersections@version{2}%
+
+% #1,#2: line 1
+% #3,#4: line 2
\def\pgf@iflinesintersect#1#2#3#4{%
- #4\relax%
- \pgf@xc=\pgf@x%
- \pgf@yc=\pgf@y%
- #3\relax%
- \advance\pgf@xc by-\pgf@x%
- \advance\pgf@yc by-\pgf@y%
- \pgf@xb=\pgf@x%
- \pgf@yb=\pgf@y%
- #2\relax%
+ % first: check bounding boxes -- but somewhat increased such that we do not
+ % exclude "visible" hits due to rounding issues (i.e. use an upper bound):
+ \pgf@intersect@boundingbox@reset%
+ \pgf@intersect@boundingbox@update{#1}%
+ \pgf@intersect@boundingbox@update{#2}%
+ \pgf@intersect@boundingbox@assign@b%
+ %
+ \pgf@intersect@boundingbox@reset%
+ \pgf@intersect@boundingbox@update{#3}%
+ \pgf@intersect@boundingbox@update{#4}%
+ \pgf@intersect@boundingbox@assign@a%
+ %
+ \pgf@intersect@boundingbox@a%
+ \pgf@intersect@boundingbox@b%
+ %
+ \pgf@intersect@boundingbox@ifoverlap@upperbound{%
+ \pgf@iflinesintersect@{#1}{#2}{#3}{#4}%
+ }{%
+ \let\pgf@intersect@next=\pgfutil@secondoftwo%
+ }%
+ \pgf@intersect@next%
+}%
+
+% a helper routine which simply defines \pgf@intersect@next.
+%
+% In principle, this routine is capable of computing the entire intersection... but we only invoke it after checking for bounding box overlaps. This has two reasons:
+% 1. robustness. almost-parallel lines could cause "dimension too large" when solving the linear equation system
+% XXX : I still needed to replace the linear solver by one using the FPU. Perhaps I do not need the BB check anymore?
+% 2. performance. I hope it is faster to first check for BB (but this is not sure in TeX)
+%
+% #1,#2: line 1
+% #3,#4: line 2
+\def\pgf@iflinesintersect@#1#2#3#4{%
+ % we have two lines of sorts
+ % l_1(s) := #1 + s * (#2 - #1), 0<= s <= 1
+ % and
+ % l_2(t) := #3 + t * (#4 - #3), 0<= t <= 1
+ % ->
+ % set up LGS
+ % ( #2 - #1 ) *s + (#3-#4) * t = #3-#1
+ % we have a hit if 0<= s,t <= 1 .
+ #1\relax%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
- #1\relax%
- \advance\pgf@xa by-\pgf@x%
- \advance\pgf@ya by-\pgf@y%
- \advance\pgf@xb by-\pgf@x%
- \advance\pgf@yb by-\pgf@y%
+ #2\relax%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ #3\relax%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ #4\relax%
%
- % xc = x4-x3; yc=y4-y3;
- % xb = x3-x1; yb=y3-y1;
- % xa = x2-x1; ya=y2-y1;
+ % will be overwritten, remember it:
+ \edef\pgf@intersect@A{%
+ \pgf@xa=\the\pgf@xa\space
+ \pgf@ya=\the\pgf@ya\space
+ }%
%
+ % B := (2-1)
+ \advance\pgf@xb by-\pgf@xa
+ \advance\pgf@yb by-\pgf@ya
%
- % Normalise a little. 16384 may not be a robust choice.
+ % A := (3-1)
+ \advance\pgf@xa by-\pgf@xc
+ \advance\pgf@ya by-\pgf@yc
+ \pgf@xa=-\pgf@xa
+ \pgf@ya=-\pgf@ya
%
- \c@pgf@counta=\pgf@xa\divide\c@pgf@counta by16384\relax%
- \c@pgf@countb=\pgf@xb\divide\c@pgf@countb by16384\relax%
- \c@pgf@countc=\pgf@ya\divide\c@pgf@countc by16384\relax%
- \c@pgf@countd=\pgf@yb\divide\c@pgf@countd by16384\relax%
- \multiply\c@pgf@counta by\c@pgf@countd%
- \multiply\c@pgf@countc by\c@pgf@countb%
- \advance\c@pgf@counta by-\c@pgf@countc%
- \pgfutil@tempcnta=\c@pgf@counta%
+ % C := (3-4)
+ \advance\pgf@xc by-\pgf@x
+ \advance\pgf@yc by-\pgf@y
%
- \c@pgf@counta=\pgf@xc\divide\c@pgf@counta by16384\relax%
- \c@pgf@countc=\pgf@yc\divide\c@pgf@countc by16384\relax%
- \multiply\c@pgf@countd by\c@pgf@counta%
- \multiply\c@pgf@countb by\c@pgf@countc%
- \advance\c@pgf@countd by-\c@pgf@countb%
- \pgfutil@tempcntb=\c@pgf@countd%
+ \begingroup
+ % compute the |.|_1 norm of each of lines. We need to compute
+ % tolerance factors in order to decide if we have an intersection.
+ % line 1: compute |#2 - #1|_1 :
+ \ifdim\pgf@xb<0sp \pgf@xb=-\pgf@xb\fi
+ \ifdim\pgf@yb<0sp \pgf@yb=-\pgf@yb\fi
+ \advance\pgf@xb by\pgf@yb
+ \xdef\pgf@intersect@len@a{\pgf@sys@tonumber\pgf@xb}%
%
- \c@pgf@countb=\pgf@xa\divide\c@pgf@countb by16384\relax%
- \c@pgf@countd=\pgf@ya\divide\c@pgf@countd by16384\relax%
- \multiply\c@pgf@counta by\c@pgf@countd%
- \multiply\c@pgf@countc by\c@pgf@countb%
- \advance\c@pgf@counta by-\c@pgf@countc%
+ % line 2: compute |#3 - #4|_1 :
+ \ifdim\pgf@xc<0sp \pgf@xc=-\pgf@xc\fi
+ \ifdim\pgf@yc<0sp \pgf@yc=-\pgf@yc\fi
+ \advance\pgf@xc by\pgf@yc
+ \xdef\pgf@intersect@len@b{\pgf@sys@tonumber\pgf@xc}%
+ \endgroup
+ %
+ \edef\pgf@marshal{%
+ \noexpand\pgfutilsolvetwotwoleqfloat{%
+ {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}%
+ {\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@yc}%
+ }{%
+ {\pgf@sys@tonumber\pgf@xa}%
+ {\pgf@sys@tonumber\pgf@ya}%
+ }%
+ }%
+ \pgf@marshal
%
- \pgf@sfalse%
- \pgf@tfalse%
- \ifnum\c@pgf@counta=0\relax%
- \else%
- \ifnum\pgfutil@tempcnta=0\relax%
- \pgf@strue%
- \else%
- \ifnum\pgfutil@tempcnta>0\relax%
- \ifnum\c@pgf@counta<\pgfutil@tempcnta%
- \else%
- \pgf@strue%
- \fi%
- \else%
- \ifnum\c@pgf@counta>\pgfutil@tempcnta%
- \else%
- \pgf@strue%
- \fi%
- \fi%
- \fi%
- \ifnum\pgfutil@tempcntb=0\relax%
- \pgf@ttrue%
- \else%
- \ifnum\pgfutil@tempcntb>0\relax%
- \ifnum\c@pgf@counta<\pgfutil@tempcntb%
- \else%
- \pgf@ttrue%
- \fi%
- \else%
- \ifnum\c@pgf@counta>\pgfutil@tempcntb%
- \else%
- \pgf@ttrue%
- \fi%
- \fi%
- \fi%
- \fi%
\let\pgf@intersect@next=\pgfutil@secondoftwo%
- \ifpgf@s%
- \ifpgf@t%
+ \ifx\pgfmathresult\pgfutil@empty
+ % matrix was singular.
+ \else
+ \def\pgf@marshal##1##2{%
+ \global\pgf@x=##1pt %
+ \global\pgf@y=##2pt %
+ }%
+ \expandafter\pgf@marshal\pgfmathresult
+ %
+ \def\pgf@marshal{XXXX}% this should never be read
+ % FIRST: check line 1:
+ \ifdim\pgf@x<0sp
+ % let it count as hit if
+ % || l_1(s) - l_1(0) || < eps
+ % <=> |s| * ||#2 - #1|| < eps
+ % and, since s< 0 here:
+ % <=> -s * ||#2 - #1|| < eps
+ \pgf@xa=-\pgf@intersect@len@a\pgf@x
+ \ifdim\pgf@xa<\pgfintersectiontolerance\relax
+ % close enough to first endpoint of line 1:
+ \def\pgf@marshal{1}%
+ \else
+ \def\pgf@marshal{0}%
+ \fi
+ \else
+ \ifdim\pgf@x>1pt
+ % let it count as hit if
+ % || l_1(s) - l_1(1) || < eps
+ % <=> |s-1| * ||#2 - #1|| < eps
+ % and, since s > 1 here:
+ % <=> s * ||#2 - #1|| - ||#2 - #1|| < eps
+ \pgf@xa=\pgf@intersect@len@a\pgf@x
+ \advance\pgf@xa by-\pgf@intersect@len@a pt %
+ \ifdim\pgf@xa<\pgfintersectiontolerance\relax
+ % close enough to second endpoint of line 1:
+ \def\pgf@marshal{1}%
+ \else
+ \def\pgf@marshal{0}%
+ \fi
+ \else
+ % 0<= s <= 1: we have an intersection within line 1.
+ \def\pgf@marshal{1}%
+ \fi
+ \fi
+ %
+ % SECOND: check line 2:
+ \if1\pgf@marshal
+ \ifdim\pgf@y<0sp
+ % see remarks for line 1. same applies here.
+ \pgf@xa=-\pgf@intersect@len@b\pgf@y
+ \ifdim\pgf@xa<\pgfintersectiontolerance\relax
+ % close enough to first endpoint of line 2:
+ \def\pgf@marshal{1}%
+ \else
+ \def\pgf@marshal{0}%
+ \fi
+ \else
+ \ifdim\pgf@y>1pt
+ % see remarks for line 1. same applies here.
+ \pgf@xa=\pgf@intersect@len@b\pgf@y
+ \advance\pgf@xa by-\pgf@intersect@len@b pt %
+ \ifdim\pgf@xa<\pgfintersectiontolerance\relax
+ % close enough to second endpoint of line 2:
+ \def\pgf@marshal{1}%
+ \else
+ \def\pgf@marshal{0}%
+ \fi
+ \else
+ % 0<= t <= 1: we have an intersection within line 2.
+ \def\pgf@marshal{1}%
+ \fi
+ \fi
+ \fi
+ %
+ \if1\pgf@marshal
+ % Ok, compute the intersection point and return it:
+ % we use (x,y) = A + s * (B-A)
+ % keep in mind that (s,t) == (\pgf@x,\pgf@y)
+ \pgf@intersect@A
+ \pgf@yc=\pgf@x
+ \global\pgf@x=\pgf@sys@tonumber\pgf@xb\pgf@yc
+ \global\pgf@y=\pgf@sys@tonumber\pgf@yb\pgf@yc
+ \global\advance\pgf@x by \pgf@xa
+ \global\advance\pgf@y by \pgf@ya
\let\pgf@intersect@next=\pgfutil@firstoftwo%
- \fi%
- \fi%
- \pgf@intersect@next%
+ \fi
+ \fi
}%
@@ -576,6 +680,7 @@
\def\pgfintersectiontolerance{0.1pt}%
+\def\pgfintersectiontoleranceupperbound{1pt}%
\def\pgfintersectiontolerancefactor{0.1}%
@@ -586,7 +691,7 @@
% #5 - #8 = curve 2.
% #9 = the solution number.
%
-% There is no guarantee of ordering of solutions. If there are
+% There is no guarantee of ordering of solutions. If there are
% no solutions, the origin is returned.
%
\def\pgfpointintersectionofcurves#1#2#3#4#5#6#7#8#9{%
@@ -600,33 +705,33 @@
% Return any intersection points of two curves C1 and C2.
% No order can be guaranteed for the solutions.
%
-% #1, #2, #3, #4 - the points on C1
+% #1, #2, #3, #4 - the points on C1
% #5, #6, #7, #8 - the points on C2
%
% Returns:
%
% \pgf@intersect@solutions - the number of solutions.
-% \pgfpointintersectionsolution{<S>} - the point for solution S.
+% \pgfpointintersectionsolution{<S>} - the point for solution S.
%
% (Sort of) use:
%
-% intersection(C1,C2)
-% S = {};
-% intersection'(C1,C2);
-% return S;
+% intersection(C1,C2)
+% S = {};
+% intersection'(C1,C2);
+% return S;
%
-% intersection'(C1,C2)
-% B1 = boundingbox(C1);
-% B2 = boundingbox(C2);
-% if intersect(B1,B2)
-% if (B1.width < q) and (B1.height < q) and
+% intersection'(C1,C2)
+% B1 = boundingbox(C1);
+% B2 = boundingbox(C2);
+% if intersect(B1,B2)
+% if (B1.width < q) and (B1.height < q) and
% (B2.width < q) and (B2.height < q)
-% S = S + {average_of_all_points(B1,B2)}; \\ is there a better choice?
-% else
-% Q = subdivideLeft(C1);
-% R = subdivideRight(C1);
-% intersection'(C2,Q);
-% intersection'(C2,R);
+% S = S + {average_of_all_points(B1,B2)}; \\ is there a better choice?
+% else
+% Q = subdivideLeft(C1);
+% R = subdivideRight(C1);
+% intersection'(C2,Q);
+% intersection'(C2,R);
%
% where q is a small value (tolerance).
%
@@ -652,42 +757,114 @@
\endgroup%
}%
+\def\pgf@intersect@boundingbox@assign@a{%
+ \edef\pgf@intersect@boundingbox@a{%
+ % lower left:
+ \noexpand\pgf@xb=\the\pgf@xa\space%
+ \noexpand\pgf@yb=\the\pgf@ya\space%
+ % upper right:
+ \noexpand\pgf@xc=\the\pgf@xb\space%
+ \noexpand\pgf@yc=\the\pgf@yb\space%
+ }%
+}%
+\def\pgf@intersect@boundingbox@assign@b{%
+ \edef\pgf@intersect@boundingbox@b{%
+ % lower left:
+ \noexpand\global\noexpand\pgf@x=\the\pgf@xa\space%
+ \noexpand\global\noexpand\pgf@y=\the\pgf@ya\space%
+ % upper right:
+ \noexpand\pgf@xa=\the\pgf@xb\space%
+ \noexpand\pgf@ya=\the\pgf@yb\space%
+ }%
+}%
+
+% see \pgf@intersect@boundingbox@assign@a and \pgf@intersect@boundingbox@assign@b for the naming conventions
+\def\pgf@intersect@boundingbox@ifoverlap{%
+ \def\pgf@intersect@next{\pgfutil@secondoftwo}%
+ %
+ \ifdim\pgf@xa<\pgf@xb%
+ \else%
+ \ifdim\pgf@x>\pgf@xc%
+ \else%
+ \ifdim\pgf@ya<\pgf@yb%
+ \else%
+ \ifdim\pgf@y>\pgf@yc%
+ \else%
+ \def\pgf@intersect@next{\pgfutil@firstoftwo}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \pgf@intersect@next
+}%
+\def\pgf@intersect@boundingbox@ifoverlap@upperbound{%
+ \begingroup
+ \def\pgf@intersect@next{\pgfutil@secondoftwo}%
+ %
+ \advance\pgf@xa by+\pgfintersectiontolerance\relax
+ \ifdim\pgf@xa<\pgf@xb%
+ \else%
+ \global\advance\pgf@x by-\pgfintersectiontolerance\relax
+ \ifdim\pgf@x>\pgf@xc%
+ \else%
+ \advance\pgf@ya by\pgfintersectiontolerance\relax
+ \ifdim\pgf@ya<\pgf@yb%
+ \else%
+ \global\advance\pgf@y by-\pgfintersectiontolerance\relax
+ \ifdim\pgf@y>\pgf@yc%
+ \else%
+ \def\pgf@intersect@next{\pgfutil@firstoftwo}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \expandafter
+ \endgroup
+ \pgf@intersect@next
+}%
+\def\pgf@intersect@boundingbox@ifoverlap@UNUSED{%
+ \let\pgf@intersect@next=\pgfutil@secondoftwo%
+ \ifdim\pgf@xa<\pgf@xb%
+ \else%
+ \ifdim\pgf@x>\pgf@xc%
+ \else%
+ \ifdim\pgf@ya<\pgf@yb%
+ \else%
+ \ifdim\pgf@y>\pgf@yc%
+ \else%
+ \let\pgf@intersect@next=\pgfutil@firstoftwo%
+ \fi
+ \fi
+ \fi
+ \fi
+ \pgf@intersect@next
+}%
\def\pgf@@intersectionofcurves#1#2#3#4#5#6#7#8{%
\pgf@intersect@boundingbox@reset%
\pgf@intersect@boundingbox@update{#1}%
\pgf@intersect@boundingbox@update{#2}%
\pgf@intersect@boundingbox@update{#3}%
\pgf@intersect@boundingbox@update{#4}%
- % (\pgf@xa, \pgf@ya) is lower-left
- % (\pgf@xb, \pgf@yb) is upper-right
- \edef\pgf@intersect@boundingbox@b{%
- \noexpand\pgf@x=\the\pgf@xa%
- \noexpand\pgf@y=\the\pgf@ya%
- \noexpand\pgf@xa=\the\pgf@xb%
- \noexpand\pgf@ya=\the\pgf@yb%
- }%
+ \pgf@intersect@boundingbox@assign@b%
+ %
\pgf@intersect@boundingbox@reset%
\pgf@intersect@boundingbox@update{#5}%
\pgf@intersect@boundingbox@update{#6}%
\pgf@intersect@boundingbox@update{#7}%
\pgf@intersect@boundingbox@update{#8}%
- \edef\pgf@intersect@boundingbox@a{%
- \noexpand\pgf@xb=\the\pgf@xa%
- \noexpand\pgf@yb=\the\pgf@ya%
- \noexpand\pgf@xc=\the\pgf@xb%
- \noexpand\pgf@yc=\the\pgf@yb%
- }%
+ \pgf@intersect@boundingbox@assign@a%
+ %
\pgf@intersect@boundingbox@a%
\pgf@intersect@boundingbox@b%
- % check if the two bounding boxes overlap:
- \ifdim\pgf@xa<\pgf@xb%
- \else%
- \ifdim\pgf@x>\pgf@xc%
- \else%
- \ifdim\pgf@ya<\pgf@yb%
- \else%
- \ifdim\pgf@y>\pgf@yc%
- \else%
+ %
+ \pgf@intersect@boundingbox@ifoverlap{%
+ \pgf@@@intersectionofcurves{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ }{%
+ % no overlap -- no intersection.
+ }%
+}%
+
+\def\pgf@@@intersectionofcurves#1#2#3#4#5#6#7#8{%
% compute DIFFERENCE vectors:
\advance\pgf@xc by-\pgf@xb%
\advance\pgf@yc by-\pgf@yb%
@@ -749,10 +926,6 @@
\else%
\pgf@intersect@subdivide@curve{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
\fi%
- \fi%
- \fi%
- \fi%
- \fi%
}%
\def\pgf@intersect@subdivide@curve@b#1#2#3#4#5#6#7#8{%
@@ -830,7 +1003,7 @@
\def\pgf@curve@subdivide@left#1#2#3#4{%
%
- % The left curve (from t=0 to t=.5)
+ % The left curve (from t=0 to t=.5)
%
\begingroup
#1\relax%
@@ -863,7 +1036,7 @@
\noexpand\pgf@curve@subdivde@after%
{\noexpand\pgf@x=\the\pgfutil@tempdima\noexpand\pgf@y=\the\pgfutil@tempdimb}%
{\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}%
- {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
+ {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}%
{\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
}%
\expandafter
@@ -873,7 +1046,7 @@
\def\pgf@curve@subdivide@right#1#2#3#4{%
%
- % The right curve (from t=0.5 to t=1)
+ % The right curve (from t=0.5 to t=1)
%
\begingroup
#1\relax%
@@ -906,8 +1079,8 @@
\edef\pgf@marshal{%
\noexpand\pgf@curve@subdivde@after%
{\noexpand\pgf@x=\pgf@float@tmpa\noexpand\pgf@y=\pgf@float@tmpb}%
- {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}
- {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
+ {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}%
+ {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}%
{\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
}%
\expandafter
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
index d3a381524ae..479992ad373 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
@@ -39,9 +39,9 @@
x=1cm, y=1cm,
parameters=,
defaults=,
- bottom left=\pgfpointorigin,
- top right=\pgfpointorigin,
- tile size=\pgfpointorigin,
+ bottom left=,
+ top right=,
+ tile size=,
tile transformation=,
code=,
set up code=,
@@ -86,11 +86,26 @@
\begingroup%
\nullfont%
\def\pgf@pat@options{#1}%
- \pgfkeys{/pgf/patterns/.cd, #1}%
- \pgf@declarepattern%
+ \pgfkeys{/pgf/patterns/.cd,#1}%
+ \ifx\pgf@pat@name\pgfutil@empty
+ \pgferror{Declaring unnamed pattern}%
+ \fi
+ \ifx\pgf@pat@bottomleft\pgfutil@empty
+ \pgferror{Bottom left corner of the bounding box unset}%
+ \fi
+ \ifx\pgf@pat@topright\pgfutil@empty
+ \pgferror{Top right corner of the bounding box unset}%
+ \fi
+ \ifx\pgf@pat@tilesize\pgfutil@empty
+ \pgferror{Tile size unset}%
+ \fi
+ \ifx\pgf@pat@code\pgfutil@empty
+ \pgferror{Pattern code is empty}%
+ \fi
+ \pgf@declarepattern@meta%
\endgroup%
}%
-\def\pgf@declarepattern{%
+\def\pgf@declarepattern@meta{%
\pgfifpatternundefined{\pgf@pat@name}{%
\ifx\pgf@pat@parameters\pgfutil@empty%
% No parameters, so pattern is declared now.
@@ -128,13 +143,13 @@
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsys@beginscope%
- \pgfinterruptboundingbox%
- \pgfsetarrows{-}%
- \pgf@pat@doifnotempty\pgf@pat@codebefore
- \pgf@pat@code%
- \pgf@pat@doifnotempty\pgf@pat@codeafter%
+ \pgfinterruptboundingbox%
+ \pgfsetarrows{-}%
+ \pgf@pat@doifnotempty\pgf@pat@codebefore
+ \pgf@pat@code%
+ \pgf@pat@doifnotempty\pgf@pat@codeafter%
+ \endpgfinterruptboundingbox%
\pgfsys@endscope%
- \endpgfinterruptboundingbox%
\pgfsysprotocol@getcurrentprotocol\pgf@pattern@code%
\global\let\pgf@pattern@code=\pgf@pattern@code%
\endpgfinterruptpath%
@@ -158,7 +173,7 @@
\pgfutil@tempcnta=\pgf@pattern@number\relax%
\advance\pgfutil@tempcnta by1\relax%
\xdef\pgf@pattern@number{\the\pgfutil@tempcnta}%
- \xdef\pgf@marshal{\noexpand\pgfsys@declarepattern@meta%
+ \xdef\pgf@marshal{\noexpand\pgfsys@declarepattern%
{\pgf@pattern@number}%
{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}\pgf@pattern@matrix{\pgf@pattern@code}{\pgf@pat@type}}%
}%
@@ -231,7 +246,7 @@
%\ifpgf@pat@makepatternimmutable%
\let\pgf@pat@parameters=\pgfutil@empty%
%\fi%
- \pgf@declarepattern%
+ \pgf@declarepattern@meta%
}{}%
\expandafter%
\endgroup%
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
index d1c3c43443e..fc08640e4f3 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
@@ -52,11 +52,6 @@
{\expandafter\noexpand\csname pgfmath#1@\endcsname}%
{\csname pgfmath@operation@#1@arity\endcsname}%
}%
- \begingroup%
- \catcode`\^^I=9\relax%
- \catcode`\ =9\relax%
- \catcode`\~=10\relax%
- \endlinechar=`\ \relax
\pgfmath@marshal%
}
@@ -66,7 +61,6 @@
% #4 - code for function <name>.
%
\def\pgfmath@@declarefunction#1#2#3#4{% Function of arity 0 - 9.
- \endgroup%
\ifcase#3\relax%
\def#1{#2}%
\def\pgfmath@@head{\def#2}%
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
index 531383dfdcd..03be2abfd33 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
@@ -180,9 +180,8 @@
%
\def\pgfmathrandominteger#1#2#3{%
\begingroup%
- \pgfmathgeneratepseudorandomnumber%
- \c@pgfmath@counta#2\relax%
- \c@pgfmath@countb#3\relax%
+ \pgfmathsetcount\c@pgfmath@counta{#2}%
+ \pgfmathsetcount\c@pgfmath@countb{#3}%
\c@pgfmath@countc\c@pgfmath@countb%
% OK. Maybe #2 > #3.
\ifnum\c@pgfmath@counta>\c@pgfmath@countb\relax%
@@ -192,12 +191,13 @@
\fi%
\advance\c@pgfmath@countc1\relax%
\advance\c@pgfmath@countc-\c@pgfmath@counta%
+ \pgfmathgeneratepseudorandomnumber%
\c@pgfmath@counta\pgfmathresult\relax%
\c@pgfmath@countb\c@pgfmath@counta%
\divide\c@pgfmath@countb\c@pgfmath@countc%
\multiply\c@pgfmath@countb-\c@pgfmath@countc%
\advance\c@pgfmath@counta\c@pgfmath@countb%
- \advance\c@pgfmath@counta#2\relax%
+ \pgfmathaddtocount\c@pgfmath@counta{#2}%
\edef\pgfmathresult{\the\c@pgfmath@counta}%
\pgfmath@smuggleone{\pgfmathresult}%
\endgroup%
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
index f9afe04d72d..c16d07005d8 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
@@ -10,6 +10,11 @@
\newif\ifpgfmathmathunitsdeclared
\newif\ifpgfmathignoreunitscale
+\let\pgfmath@protected@edef=\edef
+\ifcsname protected@edef\endcsname
+ \let\pgfmath@protected@edef=\protected@edef
+\fi
+
\def\pgfmathprint#1{\pgfmathparse{#1}\pgfmathresult}
\def\pgfmathparse{%
@@ -43,7 +48,7 @@
\global\pgfmathmathunitsdeclaredfalse
% Expand expression so any remaining CSs are registers
% or box dimensions (i.e. |\wd|, |\ht|, |\dp|).
- \edef\pgfmath@expression{#1}%
+ \pgfmath@protected@edef\pgfmath@expression{#1}%
%
\expandafter\pgfmathparse@trynumber@loop\pgfmath@expression\pgfmath@parse@stop
%
@@ -906,7 +911,7 @@
% Begin and end parenthesis ().
%
-\def\pgfmath@startgroup@#1{\edef\pgfmathresult{#1}}
+\def\pgfmath@startgroup@#1{\pgfmath@protected@edef\pgfmathresult{#1}}
\def\pgfmath@endgroup@{}% Never actually called.
% Begin and end array access [].
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
index 5dcea56c02e..78edf01c626 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
@@ -308,7 +308,6 @@
\def\pgfpositionnodenow@rename not yet positionedPGFINTERNAL#1\relax{%
\pgfnoderename{#1}{not yet positionedPGFINTERNAL#1}
- \pgf@nodecallback{#1}%
}%
diff --git a/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex b/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex
index 09573b52bec..fd972a96181 100644
--- a/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex
+++ b/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex
@@ -5,10 +5,10 @@
\catcode`\:=12
\catcode`\+=12
\catcode`\-=12
-\gdef\pgfrevision{3.1.3}
-\gdef\pgfversion{3.1.3}
-\gdef\pgfversiondatetime{2019-05-09 12:56:05 +1200}
-\gdef\pgfrevisiondatetime{2019-05-09 12:56:05 +1200}
+\gdef\pgfrevision{3.1.4}
+\gdef\pgfversion{3.1.4}
+\gdef\pgfversiondatetime{2019-07-12 11:22:12 +1200}
+\gdef\pgfrevisiondatetime{2019-07-12 11:22:12 +1200}
\gdef\pgf@glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3}
\xdef\pgfversiondate{\expandafter\pgf@glob@TMPa\pgfversiondatetime\relax}
\xdef\pgfrevisiondate{\expandafter\pgf@glob@TMPa\pgfrevisiondatetime\relax}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
index 775878dddaf..803ed71cdaf 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
@@ -289,7 +289,7 @@
%
-\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
\pgf@ya=#3\relax%
@@ -303,6 +303,14 @@
\pgf@sys@bp@correct\pgf@yb%
\pgf@sys@bp@correct\pgf@xc%
\pgf@sys@bp@correct\pgf@yc%
+ \pgfsys@@declarepattern{#1}%
+}
+
+\def\pgfsys@@declarepattern#1#2#3#4#5#6#7#8#9{%
+ \pgfutil@tempdima=#6\relax%
+ \pgfutil@tempdimb=#7\relax%
+ \pgf@sys@bp@correct\pgfutil@tempdima%
+ \pgf@sys@bp@correct\pgfutil@tempdimb%
\edef\pgf@sys@marshal{%
\noexpand\pgfutil@insertatbegincurrentpage{\noexpand\pgfsys@outerinvoke{
save true setglobal globaldict begin /pgfpat#1
@@ -319,6 +327,7 @@
/BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
/XStep \pgf@sys@tonumber\pgf@xc\space
/YStep \pgf@sys@tonumber\pgf@yc\space
+ /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
/PaintProc
{ begin 2 dict begin #8\space end end } bind
>>
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
index bc60f32c104..9dcb2e0e7c9 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
@@ -674,7 +674,7 @@
% Patterns
-\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
\pgf@ya=#3\relax%
@@ -682,6 +682,12 @@
\pgf@yb=#5\relax%
\pgf@xc=#6\relax%
\pgf@yc=#7\relax%
+ \pgfsys@@declarepattern{#1}%
+}
+
+\def\pgfsys@@declarepattern#1#2#3#4#5#6#7#8#9{%
+ \pgfutil@tempdima=#6\relax%
+ \pgfutil@tempdimb=#7\relax%
\ifnum#9=1\relax%
% Colored. That's easy:
\pgf@sys@svg@make@defs{#1}{
@@ -689,7 +695,8 @@
id="pgfpat#1"
patternUnits="userSpaceOnUse"
width="\pgf@sys@tonumber\pgf@xc"
- height="\pgf@sys@tonumber\pgf@yc">
+ height="\pgf@sys@tonumber\pgf@yc"
+ patternTransform="matrix(#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb)">
#8
</pattern>}%
\else%
@@ -699,7 +706,8 @@
id="pgfpat#1"
patternUnits="userSpaceOnUse"
width="\pgf@sys@tonumber\pgf@xc"
- height="\pgf@sys@tonumber\pgf@yc"/>
+ height="\pgf@sys@tonumber\pgf@yc"
+ patternTransform="matrix(#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb)"/>
<symbol id="pgfsym#1">
#8
</symbol>}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
index 672d791e389..5a42f65a8b8 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
@@ -86,21 +86,30 @@
\def\pgfsys@hboxsynced#1{%
\pgfsys@begin@idscope%
\pgfsys@beginscope%
- \setbox#1=\hbox{\box#1}%
- \wd#1=0pt%
- \ht#1=0pt%
- \dp#1=0pt%
- \pgfsys@dvipdfmx@suspendcontent%
- \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
- \pgfsys@dvipdfmx@start@force@reset@color%
- \pgf@sys@bp@correct\pgf@pt@x%
- \pgf@sys@bp@correct\pgf@pt@y%
- \special{pdf:btrans matrix \pgf@pt@aa\space \pgf@pt@ab\space \pgf@pt@ba\space \pgf@pt@bb\space
- \pgf@sys@tonumber{\pgf@pt@x} \pgf@sys@tonumber{\pgf@pt@y}}%
- \box#1%
- \special{pdf:etrans}%
- \pgfsys@dvipdfmx@stop@force@reset@color%
- \pgfsys@dvipdfmx@unsuspendcontent%
+ \setbox\pgf@hbox=\hbox{%
+ \hskip\pgf@pt@x%
+ \raise\pgf@pt@y\hbox{%
+ \pgf@pt@x=0pt%
+ \pgf@pt@y=0pt%
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \pgflowlevelsynccm%
+ \special{pdf: content q}%
+ \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
+ \special{pdf: content -1 0 0 -1 0 0 cm q}% \pgfsys@dvipdfmx@suspendcontent
+ \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
+ \pgfsys@dvipdfmx@start@force@reset@color%
+ \box#1%
+ \pgfsys@dvipdfmx@stop@force@reset@color%
+ \pgfsys@invoke{n Q Q Q}% \pgfsys@dvipdfmx@unsuspendcontent
+ }%
+ \hss%
+ }%
+ \wd\pgf@hbox=0pt%
+ \ht\pgf@hbox=0pt%
+ \dp\pgf@hbox=0pt%
+ \box\pgf@hbox%
\pgfsys@endscope%
\pgfsys@end@idscope%
}
@@ -336,7 +345,7 @@
% Patterns came from pgfsys-pdftex.def
% dvipdfmx provides a new special `pdf:stream' for a stream object.
-\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
\pgf@ya=#3\relax%
@@ -350,6 +359,14 @@
\pgf@sys@bp@correct\pgf@yb%
\pgf@sys@bp@correct\pgf@xc%
\pgf@sys@bp@correct\pgf@yc%
+ \pgfsys@@declarepattern{#1}%
+}
+
+\def\pgfsys@@declarepattern#1#2#3#4#5#6#7#8#9{%
+ \pgfutil@tempdima=#6\relax%
+ \pgfutil@tempdimb=#7\relax%
+ \pgf@sys@bp@correct\pgfutil@tempdima%
+ \pgf@sys@bp@correct\pgfutil@tempdimb%
% Now create the pattern object:
\pgfsys@dvipdfmx@patternobj{%
\pgfsys@dvipdfmx@stream{@pgfpatternobject#1}{#8}{%
@@ -360,6 +377,7 @@
/BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
/XStep \pgf@sys@tonumber\pgf@xc\space
/YStep \pgf@sys@tonumber\pgf@yc\space
+ /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
/Resources << >> %<<
}%
}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
index 4cb4d51b8b0..67af984e844 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
@@ -41,6 +41,25 @@
\pgfsys@invoke{pgfr}%
\pgfsys@end@idscope%
}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \pgfsys@beginscope%
+ \setbox\pgf@hbox=\hbox{%
+ \hskip\pgf@pt@x%
+ \raise\pgf@pt@y\hbox{%
+ \pgf@pt@x=0pt%
+ \pgf@pt@y=0pt%
+ \pgflowlevelsynccm%
+ \pgfsys@hbox#1}%
+ \hss%
+ }%
+ \wd\pgf@hbox=0pt%
+ \ht\pgf@hbox=0pt%
+ \dp\pgf@hbox=0pt%
+ \box\pgf@hbox%
+ \pgfsys@endscope%
+ }%
+}
\def\pgfsys@begininvisible{%
\special{ps::[begin]}%
\pgfsys@invoke{gsave nulldevice}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
index ffd5e35c6bf..a0b63c1cace 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
@@ -186,7 +186,7 @@
% Patterns
-\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
\pgf@ya=#3\relax%
@@ -200,6 +200,14 @@
\pgf@sys@bp@correct\pgf@yb%
\pgf@sys@bp@correct\pgf@xc%
\pgf@sys@bp@correct\pgf@yc%
+ \pgfsys@@declarepattern{#1}%
+}
+
+\def\pgfsys@@declarepattern#1#2#3#4#5#6#7#8#9{%
+ \pgfutil@tempdima=#6\relax%
+ \pgfutil@tempdimb=#7\relax%
+ \pgf@sys@bp@correct\pgfutil@tempdima%
+ \pgf@sys@bp@correct\pgfutil@tempdimb%
% Now create the pattern object:
\immediate\pdfextension obj stream
attr
@@ -211,6 +219,7 @@
/BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
/XStep \pgf@sys@tonumber\pgf@xc\space
/YStep \pgf@sys@tonumber\pgf@yc\space
+ /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
/Resources << >> %<<
}
{#8}%
@@ -225,54 +234,6 @@
\pgfsysprotocol@literal{/Pattern cs /pgfpat#1\space scn}%
}
-% System layer for meta patterns
-% Takes 15(!) arguments
-% #1 pattern name
-% #2 #3 bounding box lower left
-% #4 #5 bounding box upper right
-% #6 #7 tile size
-% #8 #9 #10 #11 #12 #13 transformation matrix
-% #14 protocoled text
-% #15 pattern type
-\def\pgfsys@declarepattern@meta#1#2#3#4#5#6#7{%
- % Start building the pattern dictionary:
- \pgf@xa=#2\relax%
- \pgf@ya=#3\relax%
- \pgf@xb=#4\relax%
- \pgf@yb=#5\relax%
- \pgf@xc=#6\relax%
- \pgf@yc=#7\relax%
- \pgf@sys@bp@correct\pgf@xa%
- \pgf@sys@bp@correct\pgf@ya%
- \pgf@sys@bp@correct\pgf@xb%
- \pgf@sys@bp@correct\pgf@yb%
- \pgf@sys@bp@correct\pgf@xc%
- \pgf@sys@bp@correct\pgf@yc%
- \pgfsys@@declarepattern@meta{#1}}
-
-\def\pgfsys@@declarepattern@meta#1#2#3#4#5#6#7#8#9{%
- \pgfutil@tempdima=#6\relax%
- \pgfutil@tempdimb=#7\relax%
- \pgf@sys@bp@correct\pgf@xa%
- \pgf@sys@bp@correct\pgf@ya%
- % Now create the pattern object:
- \immediate\pdfextension obj stream
- attr
- {
- /Type /Pattern
- /PatternType 1
- /PaintType \ifnum#9=0 2 \else 1 \fi
- /TilingType 1
- /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
- /XStep \pgf@sys@tonumber\pgf@xc\space
- /YStep \pgf@sys@tonumber\pgf@yc\space
- /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
- /Resources << >> %<<
- }
- {#8}%
- \pgfutil@addpdfresource@patterns{/pgfpat#1\space \the\numexpr\pdffeedback lastobj\relax\space 0 R}%
- }
-
\def\pgfsys@papersize#1#2{\pageheight#2\relax\pagewidth#1\relax}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
index 58b414b69d8..b74e005a757 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
@@ -183,7 +183,7 @@
% Patterns
-\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
\pgf@ya=#3\relax%
@@ -197,6 +197,14 @@
\pgf@sys@bp@correct\pgf@yb%
\pgf@sys@bp@correct\pgf@xc%
\pgf@sys@bp@correct\pgf@yc%
+ \pgfsys@@declarepattern{#1}%
+}
+
+\def\pgfsys@@declarepattern#1#2#3#4#5#6#7#8#9{%
+ \pgfutil@tempdima=#6\relax%
+ \pgfutil@tempdimb=#7\relax%
+ \pgf@sys@bp@correct\pgfutil@tempdima%
+ \pgf@sys@bp@correct\pgfutil@tempdimb%
% Now create the pattern object:
\immediate\pdfobj stream
attr
@@ -208,6 +216,7 @@
/BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
/XStep \pgf@sys@tonumber\pgf@xc\space
/YStep \pgf@sys@tonumber\pgf@yc\space
+ /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
/Resources << >> %<<
}
{#8}%
@@ -222,54 +231,6 @@
\pgfsysprotocol@literal{/Pattern cs /pgfpat#1\space scn}%
}
-% System layer for meta patterns
-% Takes 15(!) arguments
-% #1 pattern name
-% #2 #3 bounding box lower left
-% #4 #5 bounding box upper right
-% #6 #7 tile size
-% #8 #9 #10 #11 #12 #13 transformation matrix
-% #14 protocoled text
-% #15 pattern type
-\def\pgfsys@declarepattern@meta#1#2#3#4#5#6#7{%
- % Start building the pattern dictionary:
- \pgf@xa=#2\relax%
- \pgf@ya=#3\relax%
- \pgf@xb=#4\relax%
- \pgf@yb=#5\relax%
- \pgf@xc=#6\relax%
- \pgf@yc=#7\relax%
- \pgf@sys@bp@correct\pgf@xa%
- \pgf@sys@bp@correct\pgf@ya%
- \pgf@sys@bp@correct\pgf@xb%
- \pgf@sys@bp@correct\pgf@yb%
- \pgf@sys@bp@correct\pgf@xc%
- \pgf@sys@bp@correct\pgf@yc%
- \pgfsys@@declarepattern@meta{#1}}
-
-\def\pgfsys@@declarepattern@meta#1#2#3#4#5#6#7#8#9{%
- \pgfutil@tempdima=#6\relax%
- \pgfutil@tempdimb=#7\relax%
- \pgf@sys@bp@correct\pgf@xa%
- \pgf@sys@bp@correct\pgf@ya%
- % Now create the pattern object:
- \immediate\pdfobj stream
- attr
- {
- /Type /Pattern
- /PatternType 1
- /PaintType \ifnum#9=0 2 \else 1 \fi
- /TilingType 1
- /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
- /XStep \pgf@sys@tonumber\pgf@xc\space
- /YStep \pgf@sys@tonumber\pgf@yc\space
- /Matrix [#2\space#3\space#4\space#5\space\pgf@sys@tonumber\pgfutil@tempdima\space\pgf@sys@tonumber\pgfutil@tempdimb]
- /Resources << >> %<<
- }
- {#8}%
- \pgfutil@addpdfresource@patterns{/pgfpat#1\space \the\pdflastobj\space 0 R}%
- }
-
\def\pgfsys@papersize#1#2{\pdfpageheight#2\relax\pdfpagewidth#1\relax}
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
index 5ff18417bc6..4e351c902be 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
@@ -202,7 +202,7 @@
\def\pgffor@invokebody{%
- \pgffor@begingroup%
+ \pgffor@begingroup%
\expandafter\pgfutil@in@\expandafter/\expandafter{\pgffor@var}%
\ifpgfutil@in@%
\expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@value//\relax}%
@@ -520,12 +520,12 @@
\def\pgffor@atendforeach{%
\global\edef\pgffor@remember@expanded{\pgffor@remember@code}%
- \endgroup%
- \ifx\pgffor@remember@expanded\pgfutil@empty%
- \else%
- \pgffor@remember@expanded%
- \global\let\pgffor@remember@expanded=\pgfutil@empty%
- \fi%
+ \ifx\pgffor@remember@expanded\pgfutil@empty%
+ \else%
+ \pgffor@remember@expanded%
+ \global\let\pgffor@remember@expanded=\pgfutil@empty%
+ \fi%
+ \endgroup%
}
\def\pgffor@default@begingroup{%
\begingroup%
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
index 84d4bd5d529..2f17652628a 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
@@ -520,7 +520,11 @@
\fi%
\pgfkeys@splitter#2/%
}
-\def\pgfkeys@gobbletoslash\pgfkeys@splitter/{\expandafter\pgfkeys@remove@slash\the\pgfkeys@pathtoks\relax}%
+\def\pgfkeys@gobbletoslash\pgfkeys@splitter/{%
+ \if\relax\detokenize\expandafter{\the\pgfkeys@pathtoks}\relax\else
+ \expandafter\pgfkeys@remove@slash\the\pgfkeys@pathtoks\relax
+ \fi
+}%
\def\pgfkeys@remove@slash#1/\relax{\pgfkeys@pathtoks{#1}}
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
index 7c6d6e49cef..ef70baf021f 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
@@ -504,8 +504,6 @@
\ifpgfkeyssuccess\else
\pgfkeys@try
\ifpgfkeyssuccess\else
- % discard the '.lastretry' suffix:
- \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}%
\pgfkeys@split@path%
\pgfkeys@unknown
\fi
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
index 4eba7a9787f..6fbaf2687ba 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
@@ -75,9 +75,9 @@
\def\pgfutil@letfirst@end{}
\long\def\pgfutil@secondoftwo#1#2{#2}
\def\pgfutil@empty{}
-\def\pgfutil@gobble@until@relax#1\relax{}
-\def\pgfutil@gobble#1{}
-\def\pgfutil@gobbletwo#1#2{}
+\long\def\pgfutil@gobble@until@relax#1\relax{}
+\long\def\pgfutil@gobble#1{}
+\long\def\pgfutil@gobbletwo#1#2{}
\def\pgfutil@namedef#1{\expandafter\def\csname #1\endcsname}
\def\pgfutil@namelet#1{\expandafter\pgfutil@@namelet\csname#1\endcsname}
\def\pgfutil@@namelet#1#2{\expandafter\let\expandafter#1\csname#2\endcsname}
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
index 2539c764e44..bf7e43a298c 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
@@ -147,6 +147,11 @@
\def\pgfutil@emu@select#1#2#3#4#5{#5}
+\def\XC@tgt@mod#1{#1}
+\def\XC@sdef#1#2{\edef#1{#2}}
+\def\XC@mod@cmyk{cmyk}
+\def\XC@mod@rgb{rgb}
+
% goody
\let\colorlet=\pgfutil@colorlet
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
index 97f884aff95..2ac8ec42120 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
@@ -189,9 +189,9 @@
% pgfcalendar uses translations
\ifx\translate\@undefined % check if \translate is available
- \def\pgfutil@translate#1{\translate{#1}}
-\else
\def\pgfutil@translate#1{#1}
+\else
+ \def\pgfutil@translate#1{\translate{#1}}
\fi
% e-TeX primitives
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
index 14ebcf4b986..090fcaeb5ae 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
@@ -140,7 +140,10 @@
\let\extractcolorspec=\pgfutil@extractcolorspec
\let\convertcolorspec=\pgfutil@convertcolorspec
-
+\def\XC@tgt@mod#1{#1}
+\def\XC@sdef#1#2{\edef#1{#2}}
+\def\XC@mod@cmyk{cmyk}
+\def\XC@mod@rgb{rgb}
% pgfutil@minipage