diff options
Diffstat (limited to 'graphics/pgf/contrib/jigsaw/jigsaw.sty')
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw.sty | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/graphics/pgf/contrib/jigsaw/jigsaw.sty b/graphics/pgf/contrib/jigsaw/jigsaw.sty index ae1a736042..ad8bcc9674 100644 --- a/graphics/pgf/contrib/jigsaw/jigsaw.sty +++ b/graphics/pgf/contrib/jigsaw/jigsaw.sty @@ -40,19 +40,19 @@ } \newcommand{\halfpiece}[2]{ - \draw \side{#1} [rotate around={90:(0.5,0.5)}] \side{#2}; + \draw \side{#1} [rotate around={90:(0.5,0.5)}] \side{#2}; } \newcommand{\piece}[5][\@nil]{ - \def\tmp{#1}% - \ifx\tmp\@nnil - \else - \fill[#1] - \side{#2} - [rotate around={90:(0.5,0.5)}] -- \side{#3} - [rotate around={90:(0.5,0.5)}] -- \side{#4} - [rotate around={90:(0.5,0.5)}] -- \side{#5} - -- cycle; + \def\tmp{#1}% + \ifx\tmp\@nnil + \else + \fill[#1] + \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + [rotate around={90:(0.5,0.5)}] -- \side{#5} + -- cycle; \fi \draw \side{#2} @@ -62,12 +62,12 @@ } \newcommand{\tile}[5][\@nil]{% - \begin{tikzpicture} - \path (0,0) rectangle (1,0.97); - \begin{pgfinterruptboundingbox} - \piece[#1]{#2}{#3}{#4}{#5} - \end{pgfinterruptboundingbox} - \end{tikzpicture}% + \begin{tikzpicture} + \path (0,0) rectangle (1,0.97); + \begin{pgfinterruptboundingbox} + \piece[#1]{#2}{#3}{#4}{#5} + \end{pgfinterruptboundingbox} + \end{tikzpicture}% } \pgfmathdeclarerandomlist{inout}{{-1}{1}} @@ -99,12 +99,15 @@ pics/piece/.style n args={4}{ inherit options/.code={\csname tikz@options\endcsname},inherit options, code = { - \path[pic actions] - \side{#1} - [rotate around={90:(0.5,0.5)}] -- \side{#2} - [rotate around={90:(0.5,0.5)}] -- \side{#3} - [rotate around={90:(0.5,0.5)}] -- \side{#4} - -- cycle; + \path (0,0) rectangle (1,1); + \begin{pgfinterruptboundingbox} + \path[pic actions] + \side{#1} + [rotate around={90:(0.5,0.5)}] -- \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + -- cycle; + \end{pgfinterruptboundingbox} } }, piece/.search also={,/tikz,/pgf}, |