Skip to content

Commit 3b6cd58

Browse files
committed
- split the translate operation
1 parent 0029a5a commit 3b6cd58

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

chapter-08-dictionaries_and_json/coffee_chart/coffee_chart.pyde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ translate(100, 100)
1414
for coffee in coffees:
1515
# ingredients goes here
1616
pushMatrix()
17-
17+
translate(0, mug)
1818
for ingredient in coffee['ingredients']:
1919
ml = ingredient['quantity']
2020
fill(ingredient['color'])
2121
noStroke()
22-
rect(0, mug-ml, mug, ml)
22+
rect(0, 0, mug, -ml)
2323
translate(0, -ml)
24-
2524
popMatrix()
2625

2726
# mug

0 commit comments

Comments
 (0)