diff options
Diffstat (limited to 'graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex')
-rw-r--r-- | graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex b/graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex index 7cad25e42b..aa732ab835 100644 --- a/graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex +++ b/graphics/pgf/contrib/tikz-ext/tikzlibraryext.patterns.images.code.tex @@ -1,3 +1,10 @@ +% 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. +% % This is the TikZ library patterns.images % Load with \usetikzlibrary{patterns.images} % @@ -8,13 +15,13 @@ % - use image as pattern=<name> % - image as pattern=<opt arguments for \pgftext> -\def\pgfsetupimageaspattern{\pgfutil@ifnextchar[\qrr@pgfsetupimageaspattern{\qrr@pgfsetupimageaspattern[]}} -\def\qrr@pgfsetupimageaspattern[#1]#2#3{% #1 = options +\def\pgfsetupimageaspattern{\pgfutil@ifnextchar[\tikzext@pgfsetupimageaspattern{\tikzext@pgfsetupimageaspattern[]}} +\def\tikzext@pgfsetupimageaspattern[#1]#2#3{% #1 = options % #2 = image name % #3 = file name - \pgfdeclareimage[#1]{qrr@pgf@iap@#2}{#3}% - \sbox\pgfutil@tempboxa{\pgfuseimage{qrr@pgf@iap@#2}}% - \expandafter\edef\csname qrr@pgf@iap@#2@\endcsname{{\the\wd\pgfutil@tempboxa}{\the\ht\pgfutil@tempboxa}}% + \pgfdeclareimage[#1]{tikzext@pgf@iap@#2}{#3}% + \sbox\pgfutil@tempboxa{\pgfuseimage{tikzext@pgf@iap@#2}}% + \expandafter\edef\csname tikzext@pgf@iap@#2@\endcsname{{\the\wd\pgfutil@tempboxa}{\the\ht\pgfutil@tempboxa}}% } \tikzset{ image as pattern/name/.initial=, @@ -22,13 +29,13 @@ image as pattern/options/.style={/tikz/image as pattern/option/.append style={#1}}, image as pattern/.default=, image as pattern/.code={ - \tikzset{image as pattern/.cd,#1} + \pgfqkeys{/tikz/image as pattern}{#1}% \pgfkeysgetvalue{/tikz/image as pattern/name}\tikz@temp \pgfutil@ifxempty\tikz@temp{% \tikzerror{You need to specify a name for the ``image-pattern'' to be used.}% }{% - \edef\tikz@tempa{\expandafter\expandafter\expandafter\pgfutil@firstoftwo\csname qrr@pgf@iap@\tikz@temp @\endcsname}% - \edef\tikz@tempb{\expandafter\expandafter\expandafter\pgfutil@secondoftwo\csname qrr@pgf@iap@\tikz@temp @\endcsname}% + \edef\tikz@tempa{\expandafter\expandafter\expandafter\pgfutil@firstoftwo\csname tikzext@pgf@iap@\tikz@temp @\endcsname}% + \edef\tikz@tempb{\expandafter\expandafter\expandafter\pgfutil@secondoftwo\csname tikzext@pgf@iap@\tikz@temp @\endcsname}% \pgfkeysalso{/tikz/path picture={% \pgf@process{\pgfpointanchor{path picture bounding box}{north east}}% \pgf@xa\pgf@x\pgf@ya\pgf@y @@ -37,7 +44,7 @@ \pgfutil@loop {% \pgfutil@loop - \expandafter\pgftext\expandafter[/tikz/image as pattern/option,at=\pgfqpoint{\pgf@xb}{\pgf@yb}]{\pgfuseimage{qrr@pgf@iap@\tikz@temp}}% + \expandafter\pgftext\expandafter[/tikz/image as pattern/option,at=\pgfqpoint{\pgf@xb}{\pgf@yb}]{\pgfuseimage{tikzext@pgf@iap@\tikz@temp}}% \ifdim\pgf@yb<\pgf@ya \advance\pgf@yb\tikz@tempb \pgfutil@repeat |