summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-ext/tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/tikz-ext/tex')
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex2
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex139
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex11
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex307
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex77
-rw-r--r--graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex4
6 files changed, 463 insertions, 77 deletions
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex
index 90b42a0011..fae3508e15 100644
--- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex
@@ -359,7 +359,7 @@
\pgfcalendar@launch@ifdate{#2}{#3}{#4}%
}
-\pgfqkeys{/pgf/calendar/week}{.value required,.code=\ifnum#1=\pgfcalendarifdateweek\relax\expandafter\pgfcalendarmatchestrue\fi}
+\pgfqkeys{/pgf/calendar/week}{.value required,.code={\ifnum#1=\pgfcalendarifdateweek\relax\expandafter\pgfcalendarmatchestrue\fi}}
% Overwriting shorthands of pgfcalendar
\expandafter\def\csname pgfcalendar@shorthand@d-\endcsname{%
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex
new file mode 100644
index 0000000000..49aedb64c6
--- /dev/null
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex
@@ -0,0 +1,139 @@
+% Copyright 2022 by Qrrbrbirlbel
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+
+\input pgfmath.tex
+
+%% Handlers
+%% .pgfmath evaluates values given to keys in PGFmath before handing them over.
+%% .pgfmath int truncates the result
+%% .pgfmath strcat concatenates the given values
+\pgfqkeys{/handlers}{
+ .pgfmath/.code=%
+ \begingroup
+ \pgfmathparse{#1}%
+ \expandafter\endgroup\expandafter
+ \pgfkeys@exp@call\expandafter{\pgfmathresult},
+ .pgfmath int/.code=%
+ \begingroup
+ \pgfmathint{#1}%
+ \expandafter\endgroup\expandafter
+ \pgfkeys@exp@call\expandafter{\pgfmathresult},
+ .pgfmath wrap/.code 2 args={%
+ \def\pgfkeys@temp##1{\def\pgfkeys@temp{#1}}%
+ \begingroup
+ \pgfmathparse{#2}%
+ \expandafter\pgfkeys@temp\expandafter{\pgfmathresult}%
+ \expandafter\endgroup\expandafter
+ \pgfkeys@exp@call\expandafter{\pgfkeys@temp}%
+ },
+ .pgfmath if/.code n args={3}{%
+ \begingroup
+ \pgfmathifthenelse{#1}{"1"}{"0"}%
+ \expandafter\endgroup\expandafter
+ \ifcase\pgfmathresult\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeys@exp@call{#3}}%
+ {\pgfkeys@exp@call{#2}}%
+ },
+ .if/.code n args={4}{%
+ \if#1#2%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeys@exp@call{#3}}%
+ {\pgfkeys@exp@call{#4}}%
+ },
+ .ifnum/.code n args={3}{%
+ \ifnum#1\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeys@exp@call{#2}}%
+ {\pgfkeys@exp@call{#3}}%
+ },
+ .ifdim/.code n args={3}{%
+ \ifdim#1\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeys@exp@call{#2}}%
+ {\pgfkeys@exp@call{#3}}%
+ },
+ .ifx/.code n args={4}{%
+ \ifx#1#2%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeys@exp@call{#3}}%
+ {\pgfkeys@exp@call{#4}}%
+ },
+ .ifxempty/.code n args={3}{%
+ \edef\pgfkeys@temp{#1}%
+ \pgfutil@ifxempty\pgfkeys@temp{\pgfkeys@exp@call{#2}}{\pgfkeys@exp@call{#3}}%
+ },
+ .ifempty/.code n args={3}{%
+ \pgfutil@ifempty{#1}{\pgfkeys@exp@call{#2}}{\pgfkeys@exp@call{#3}}%
+ },
+ %% http://tex.stackexchange.com/a/144187/16595
+ %% key/.List={(point-1),(point-2),(point-...),(point-6)} will call
+ %% key=(point-1)(point-2)(point-3)(point-4)(point-5),(point-6)
+ .List/.code=%
+ \let\pgfkeys@global@temp\pgfutil@empty
+ \foreach\pgfkeys@temp in{#1}{%
+ \expandafter\pgfutil@g@addto@macro\expandafter\pgfkeys@global@temp\expandafter{\pgfkeys@temp}%
+ }%
+ \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@global@temp}%
+}
+
+\pgfqkeys{/utils}{
+ if/.code n args={3}{%
+ \begingroup
+ \pgfmathifthenelse{#1}{"1"}{"0"}%
+ \expandafter\endgroup\expandafter
+ \ifcase\pgfmathresult\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {\pgfkeysalso{#3}}
+ {\pgfkeysalso{#2}}%
+ },
+ TeX/if/.code n args={4}{%
+ \if#1#2\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
+ {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}%
+ },
+ TeX/ifnum/.code n args={3}{%
+ \ifnum#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
+ {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
+ },
+ TeX/ifdim/.code n args={3}{%
+ \ifdim#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
+ {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
+ },
+ TeX/ifx/.code n args={4}{%
+ \ifx#1#2\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
+ {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}%
+ },
+ TeX/ifxempty/.code n args={3}{%
+ \edef\pgfkeys@temp{#1}%
+ \pgfutil@ifxempty\pgfkeys@temp{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
+ },
+ TeX/ifempty/.code n args={3}{%
+ \pgfutil@ifempty{#1}{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
+ },
+ tex/.search also=/utils/TeX,
+}
+
+\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex
new file mode 100644
index 0000000000..6101ca8cad
--- /dev/null
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex
@@ -0,0 +1,11 @@
+% Copyright 2022 by Qrrbrbirlbel
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+
+\input pgfkeyslibraryext.pgfkeys-plus.code.tex
+
+\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex
new file mode 100644
index 0000000000..630a22da14
--- /dev/null
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex
@@ -0,0 +1,307 @@
+% Copyright 2022 by Qrrbrbirlbel
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+\pgfutil@IfUndefined{pgfnodepartthreebox}{%
+ \newbox\pgfnodepartleftbox
+ \newbox\pgfnodepartrightbox
+}{%
+ \let\pgfnodepartleftbox\pgfnodeparttwobox
+ \let\pgfnodepartrightbox\pgfnodepartthreebox
+}
+\pgfset{
+ uncentered rectangle center yshift/.initial=,
+ uncentered rectangle center/@center/.initial=2,
+ uncentered rectangle center/.is choice,
+ uncentered rectangle center/real/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{0},
+ uncentered rectangle center/left/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{1},
+ uncentered rectangle center/text/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{2},
+ uncentered rectangle center/right/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{3}}
+
+\pgfdeclareshape{uncentered rectangle}{%
+ \nodeparts{text,left,right}%
+ \savedanchor\middleCenter{%
+ \pgf@x=.5\wd\pgfnodeparttextbox
+ %
+ \pgf@y=\dp\pgfnodeparttextbox
+ \ifdim\dp\pgfnodepartleftbox>\pgf@y
+ \pgf@y=\dp\pgfnodepartleftbox
+ \fi
+ \ifdim\dp\pgfnodepartrightbox>\pgf@y
+ \pgf@y=\dp\pgfnodepartrightbox
+ \fi
+ %
+ \pgf@ya=\ht\pgfnodeparttextbox
+ \ifdim\ht\pgfnodepartleftbox>\pgf@ya
+ \pgf@ya=\ht\pgfnodepartleftbox
+ \fi
+ \ifdim\ht\pgfnodepartrightbox>\pgf@ya
+ \pgf@ya=\ht\pgfnodepartrightbox
+ \fi
+ \advance\pgf@ya by -\pgf@y
+ \pgf@y=.5\pgf@ya
+ }%
+ \savedanchor\leftCenter{%
+ % y should be still the same as before
+ \pgf@x=-.5\wd\pgfnodepartleftbox
+ }%
+ \savedanchor\rightCenter{%
+ % y should be still the same as before
+ \pgf@x=.5\wd\pgfnodepartrightbox
+ \advance\pgf@x by \wd\pgfnodeparttextbox
+ }%
+ \savedanchor\realCenter{%
+ % y should be still the same as before
+ \pgf@x=-.5\wd\pgfnodepartleftbox
+ \advance\pgf@x by .5\wd\pgfnodeparttextbox
+ \advance\pgf@x by .5\wd\pgfnodepartrightbox
+ }%
+ \savedanchor\southwest{%
+ % total width
+ \pgf@xa=\wd\pgfnodepartleftbox
+ \advance\pgf@xa by\wd\pgfnodepartrightbox
+ \advance\pgf@xa by\wd\pgfnodeparttextbox
+ %
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa by 2\pgf@xc
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@xb>\pgf@xa
+ \pgf@xa=\pgf@xb
+ \fi
+ % left side of shape
+ \advance\pgf@x by -.5\pgf@xa
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \advance\pgf@x by -\pgf@xa
+ %
+ % total height
+ \pgf@ya=\dp\pgfnodepartleftbox
+ \ifdim\pgf@ya<\dp\pgfnodeparttextbox
+ \pgf@ya=\dp\pgfnodeparttextbox
+ \fi
+ \ifdim\pgf@ya<\dp\pgfnodepartrightbox
+ \pgf@ya=\dp\pgfnodepartrightbox
+ \fi
+ \pgf@yb=\ht\pgfnodepartleftbox
+ \ifdim\pgf@yb<\ht\pgfnodeparttextbox
+ \pgf@yb=\ht\pgfnodeparttextbox
+ \fi
+ \ifdim\pgf@yb<\ht\pgfnodepartrightbox
+ \pgf@yb=\ht\pgfnodepartrightbox
+ \fi
+ \advance\pgf@ya by \pgf@yb
+ %
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya by 2\pgf@yc
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@yb>\pgf@ya
+ \pgf@ya=\pgf@yb
+ \fi
+ % lower side of the shape
+ \advance\pgf@y by -.5\pgf@ya
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \advance\pgf@y by -\pgf@ya
+ }%
+ \savedanchor\northeast{%
+ % first, let's calculate the real center again:
+ %
+ \pgf@x=-.5\wd\pgfnodepartleftbox
+ \advance\pgf@x by .5\wd\pgfnodeparttextbox
+ \advance\pgf@x by .5\wd\pgfnodepartrightbox
+ %
+ \pgf@y=\dp\pgfnodeparttextbox
+ \ifdim\dp\pgfnodepartleftbox>\pgf@y
+ \pgf@y=\dp\pgfnodepartleftbox
+ \fi
+ \ifdim\dp\pgfnodepartrightbox>\pgf@y
+ \pgf@y=\dp\pgfnodepartrightbox
+ \fi
+ %
+ \pgf@ya=\ht\pgfnodeparttextbox
+ \ifdim\ht\pgfnodepartleftbox>\pgf@ya
+ \pgf@ya=\ht\pgfnodepartleftbox
+ \fi
+ \ifdim\ht\pgfnodepartrightbox>\pgf@ya
+ \pgf@ya=\ht\pgfnodepartrightbox
+ \fi
+ \advance\pgf@ya by -\pgf@y
+ \pgf@y=.5\pgf@ya
+ %
+ % now we can calculate the anchor
+ % total width
+ %
+ \pgf@xa=\wd\pgfnodepartleftbox
+ \advance\pgf@xa by\wd\pgfnodepartrightbox
+ \advance\pgf@xa by\wd\pgfnodeparttextbox
+ %
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa by 2\pgf@xc
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@xb>\pgf@xa
+ \pgf@xa=\pgf@xb
+ \fi
+ % right side of shape
+ \advance\pgf@x by .5\pgf@xa
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \advance\pgf@x by \pgf@xa
+ %
+ % total height
+ \pgf@ya=\dp\pgfnodepartleftbox
+ \ifdim\pgf@ya<\dp\pgfnodeparttextbox
+ \pgf@ya=\dp\pgfnodeparttextbox
+ \fi
+ \ifdim\pgf@ya<\dp\pgfnodepartrightbox
+ \pgf@ya=\dp\pgfnodepartrightbox
+ \fi
+ \pgf@yb=\ht\pgfnodepartleftbox
+ \ifdim\pgf@yb<\ht\pgfnodeparttextbox
+ \pgf@yb=\ht\pgfnodeparttextbox
+ \fi
+ \ifdim\pgf@yb<\ht\pgfnodepartrightbox
+ \pgf@yb=\ht\pgfnodepartrightbox
+ \fi
+ \advance\pgf@ya by \pgf@yb
+ %
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya by 2\pgf@yc
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@yb>\pgf@ya
+ \pgf@ya=\pgf@yb
+ \fi
+ % upper side of the shape
+ \advance\pgf@y by .5\pgf@ya
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \advance\pgf@y by \pgf@ya
+ }%
+ %
+ \anchor{center}{%
+ \ifcase\pgfkeysvalueof{/pgf/uncentered rectangle center/@center}\relax
+ \realCenter\or
+ \leftCenter\or
+ \middleCenter\or
+ \rightCenter\else
+ \realCenter
+ \fi
+ \pgfkeysgetvalue{/pgf/uncentered rectangle center yshift}\pgf@temp
+ \pgfutil@ifxempty\pgf@temp{% real center used
+ }{% calculate center
+ \pgfmathsetlength\pgf@y{\pgf@temp}%
+ }%
+ }%
+ \anchor{left} {\leftCenter \multiply\pgf@x by2 \pgf@y=0pt }
+ \anchor{right} {\middleCenter\multiply\pgf@x by2 \pgf@y=0pt }
+ \anchor{real center} {\realCenter}
+ \anchor{left center} {\leftCenter}
+ \anchor{right center}{\rightCenter}
+ \anchor{text center} {\middleCenter}
+ \anchor{south west} {\southwest}
+ \anchor{north east} {\northeast}
+ \anchor{mid}{%
+ \csname pgf@anchor@uncentered rectangle@center\endcsname
+ \pgfmathsetlength\pgf@y{.5ex}}%
+ \anchor{base}{%
+ \csname pgf@anchor@uncentered rectangle@center\endcsname
+ \pgf@y=0pt }%
+ \anchor{left mid} {\leftCenter \pgfmathsetlength\pgf@y{+.5ex}}
+ \anchor{text mid} {\middleCenter\pgfmathsetlength\pgf@y{+.5ex}}
+ \anchor{right mid} {\rightCenter \pgfmathsetlength\pgf@y{+.5ex}}
+ \anchor{real mid} {\realCenter \pgfmathsetlength\pgf@y{+.5ex}}
+ \anchor{left base} {\leftCenter \pgf@y=0pt }
+ \anchor{text base} {\middleCenter\pgf@y=0pt }
+ \anchor{right base} {\rightCenter \pgf@y=0pt }
+ \anchor{real base} {\realCenter \pgf@y=0pt }
+ \anchor{real south} {\pgf@anchor@rectangle@south}
+ \anchor{real north} {\pgf@anchor@rectangle@north}
+ \anchor{text north} {\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\middleCenter\pgf@y=\pgf@ya}
+ \anchor{left north} {\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\leftCenter \pgf@y=\pgf@ya}
+ \anchor{right north}{\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\rightCenter \pgf@y=\pgf@ya}
+ \anchor{text south} {\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\middleCenter\pgf@y=\pgf@ya}
+ \anchor{left south} {\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\leftCenter \pgf@y=\pgf@ya}
+ \anchor{right south}{\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\rightCenter \pgf@y=\pgf@ya}
+ \anchor{north}{%
+ \pgf@anchor@rectangle@north
+ \pgf@ya=\pgf@y
+ \csname pgf@anchor@uncentered rectangle@center\endcsname
+ \pgf@y=\pgf@ya
+ }
+ \anchor{south}{%
+ \pgf@anchor@rectangle@south
+ \pgf@ya=\pgf@y
+ \csname pgf@anchor@uncentered rectangle@center\endcsname
+ \pgf@y=\pgf@ya
+ }
+ %\anchor{base right}{\middleCenter\pgf@xa=2\pgf@x}% TODO
+ \anchor{real west}{%
+ \pgf@process{\northeast}%
+ \pgf@ya=.5\pgf@y
+ \pgf@process{\southwest}%
+ \pgf@y=.5\pgf@y
+ \advance\pgf@y by \pgf@ya
+ }%
+ \anchor{real east}{%
+ \pgf@process{\southwest}%
+ \pgf@ya=.5\pgf@y
+ \pgf@process{\northeast}%
+ \pgf@y=.5\pgf@y
+ \advance\pgf@y by \pgf@ya
+ }%
+ \anchor{west}{%
+ \pgf@process{\southwest}%
+ \pgf@xa=\pgf@x
+ \pgf@process{\csname pgf@anchor@uncentered rectangle@center\endcsname}%
+ \pgf@x=\pgf@xa
+ }%
+ \anchor{east}{%
+ \pgf@process{\northeast}%
+ \pgf@xa=\pgf@x
+ \pgf@process{\csname pgf@anchor@uncentered rectangle@center\endcsname}%
+ \pgf@x=\pgf@xa
+ }%
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{mid west}
+ \inheritanchor[from=rectangle]{mid east}
+ \inheritanchor[from=rectangle]{base west}
+ \inheritanchor[from=rectangle]{base east}
+ \inheritbackgroundpath[from=rectangle]
+ \anchorborder{%
+ % xa/ya is target
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ % xc/yc is "center"
+ \pgf@sh@reanchor{uncentered rectangle}{center}%
+ \pgf@xc=\pgf@x
+ \pgf@yc=\pgf@y
+ \ifdim\pgf@xa<0pt
+ % left side
+ \southwest
+ \advance\pgf@x by -\pgf@xc
+ \advance\pgf@y by -\pgf@yc
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ \edef\pgf@marshal{%
+ \noexpand\pgfpointborderrectangle
+ {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ }%
+ \else
+ % right side
+ \northeast
+ \advance\pgf@x by -\pgf@xc
+ \advance\pgf@y by -\pgf@yc
+ \edef\pgf@marshal{%
+ \noexpand\pgfpointborderrectangle
+ {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ }%
+ \fi
+ \pgf@process{\pgf@marshal}%
+ \advance\pgf@x by\pgf@xc
+ \advance\pgf@y by\pgf@yc
+ }%
+}
+\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex
index 830b3513e5..a5a982020f 100644
--- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex
@@ -5,6 +5,8 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%
+\usepgflibrary{ext.pgfkeys-plus}%
+
%% full arc
%% https://tex.stackexchange.com/a/144297/16595
%% The postfix operator R is added to PGFmath,
@@ -73,28 +75,6 @@
{\tikzext@pgf@foreach@no@listfalse\pgffor@macro@list\tikzext@pgf@foreach@no@list@list}
{\pgffor@@vars}}}}}%
-%% Handlers
-%% .pgfmath evaluates values given to keys in PGFmath before handing them over.
-%% .pgfmath int truncates the result
-%% .pgfmath strcat concatenates the given values
-\pgfkeys{/handlers/.pgfmath/.code=\pgfmathparse{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}}
-\pgfkeys{/handlers/.pgfmath int/.code=\pgfmathint{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}}
-\pgfkeys{/handlers/.pgfmath strcat/.code=\pgfmathstrcat{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}}
-
-%% http://tex.stackexchange.com/a/144187/16595
-%% key/.List={(point-1),(point-2),(point-...),(point-6)} will call
-%% key=(point-1)(point-2)(point-3)(point-4)(point-5),(point-6)
-\pgfkeys{/handlers/.List/.code={%
- \let\pgfkeys@global@temp\pgfutil@empty
- \foreach \pgfkeys@temp in{#1}{
- \ifx\pgfkeys@global@temp\pgfutil@empty
- \global\let\pgfkeys@global@temp\pgfkeys@temp
- \else
- \expandafter\pgfutil@g@addto@macro\expandafter\pgfkeys@global@temp\expandafter
- {\pgfkeys@temp}%
- \fi}%
- \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@global@temp}}}
-
%% PGFmath
%% strrepeat("x", 5) = "xxxxx"
\pgfmathdeclarefunction{strrepeat}{2}{%
@@ -175,62 +155,11 @@
\pgfmathdeclarefunction{isEmpty}{1}{%
\begingroup
- \edef\pgfmath@temp{#1}%
+ \def\pgfmath@temp{#1}%
\pgfutil@ifxempty\pgfmath@temp{\def\pgfmathresult{1}}{\def\pgfmathresult{0}}%
\pgfmath@smuggleone\pgfmathresult
\endgroup}
-\pgfqkeys{/utils}{
- if/.code n args=3{%
- \pgfmathparse{#1}%
- \ifdim\pgfmathresult pt=0pt
- \expandafter\pgfutil@firstoftwo
- \else
- \expandafter\pgfutil@secondoftwo
- \fi
- {\pgfkeysalso{#3}}%
- {\pgfkeysalso{#2}}},
- IF/.code args={(#1)#2}{%
- \pgfmathparse{#1}%
- \pgfutil@in@{else}{#2}%
- \ifpgfutil@in@
- \expandafter\pgfutil@firstoftwo
- \else
- \expandafter\pgfutil@secondoftwo
- \fi
- {\tikzext@misc@handle@else#2\pgf@stop}{\tikzext@misc@handle@else#2else\pgf@stop}%
- },
- TeX/if/.code n args={4}{%
- \if#1#2\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
- {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}%
- },
- TeX/ifnum/.code n args={3}{%
- \ifnum#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
- {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
- },
- TeX/ifdim/.code n args={3}{%
- \ifdim#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
- {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
- },
- TeX/ifx/.code n args={4}{%
- \ifx#1#2\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi
- {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}%
- },
- TeX/ifempty/.code n args={3}{%
- \edef\pgfkeys@temp{#1}%
- \pgfutil@ifxempty\pgfkeys@temp{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
- },
- tex/.search also=/utils/TeX,
-}
-\def\tikzext@misc@handle@else#1else#2\pgf@stop{%
- \ifdim\pgfmathresult pt=0pt
- \expandafter\pgfutil@firstoftwo
- \else
- \expandafter\pgfutil@secondoftwo
- \fi
- {\pgfkeysalso{#2}}%
- {\pgfkeysalso{#1}}}
-
\pgfset{
declare constant/.code={%
\let\pgfmathdeclareconstant@@@\pgfutil@empty
diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex
index c75f31b60a..e97bbf939d 100644
--- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex
+++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex
@@ -306,12 +306,12 @@
% make sure direction is properly followed
\ifdim\pgf@arcto@fS pt=1pt
% counter clockwise
- \ifdim\pgf@arcto@theta@end pt<\pgf@arcto@theta@start path
+ \ifdim\pgf@arcto@theta@end pt<\pgf@arcto@theta@start pt
\pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}%
\fi
\else
% clockwise
- \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start path
+ \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt
\pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}%
\fi
\fi