Skip to content

Commit 7a4c6f3

Browse files
PieChart.pde function uses argument
pieChart function uses a mix of its argument (data[]) and the original global array (angles[]). Fixed so it uses only the argument.
1 parent 9c1671c commit 7a4c6f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/examples/Basics/Form/PieChart/PieChart.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ void pieChart(float diameter, int[] data) {
2323
for (int i = 0; i < data.length; i++) {
2424
float gray = map(i, 0, data.length, 0, 255);
2525
fill(gray);
26-
arc(width/2, height/2, diameter, diameter, lastAngle, lastAngle+radians(angles[i]));
27-
lastAngle += radians(angles[i]);
26+
arc(width/2, height/2, diameter, diameter, lastAngle, lastAngle+radians(data[i]));
27+
lastAngle += radians(data[i]);
2828
}
2929
}
3030

0 commit comments

Comments
 (0)