From 1f28e4dc5f1f6d8e61fea4f10ea3d2451138c408 Mon Sep 17 00:00:00 2001
From: Xu Yuan <xu@informatik.hu-berlin.de>
Date: Sat, 1 Oct 2011 13:40:02 +0200
Subject: bugfix in finding explode from array input

---
 dev/pgf-pie.sty | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'dev/pgf-pie.sty')

diff --git a/dev/pgf-pie.sty b/dev/pgf-pie.sty
index a9347ad..ffbee97 100644
--- a/dev/pgf-pie.sty
+++ b/dev/pgf-pie.sty
@@ -80,7 +80,6 @@ chart by using PGF/Tikz package.]
   }
   \pgfkeys{#1}
 
-  \def\explodearray{{\explode}}
   \setcounter{pgfpie@explodeLength}{0}
   \foreach \e in \explode { \addtocounter{pgfpie@explodeLength}{1} }
 
@@ -95,8 +94,14 @@ chart by using PGF/Tikz package.]
     \addtocounter{pgfpie@angleEnd}{\p}
 
     % find explode
-    \pgfmathparse{\explodearray[int(mod(\i,\value{pgfpie@explodeLength}))]}
-    \let\e\pgfmathresult
+    \pgfmathparse{int(mod(\i,\value{pgfpie@explodeLength}))}
+    \let\ei\pgfmathresult
+    \foreach \e [count=\j from 0] in \explode {
+      \ifnum \j=\ei
+      \xdef\theexplode{\e}
+      \breakforeach
+      \fi
+    }
 
     % find color
     \pgfmathparse{int(mod(\i,\value{pgfpie@colorLength}))}
@@ -112,7 +117,7 @@ chart by using PGF/Tikz package.]
     {\thepgfpie@angleEnd/100*360}
     {\beforenumber \p \afternumber}
     {\t}
-    {\e}
+    {\theexplode}
     {\thecolor}
     {\radius}
     {\pos}
-- 
cgit v1.2.3

