Skip to content

Commit 2dc36ac

Browse files
authored
Merge pull request #4 from arekrataj/P2_3_3_fix
Fix for UNDO feature in P_2_3_3_01_TABLET_TOOL
2 parents ef1f587 + 7047e9a commit 2dc36ac

File tree

1 file changed

+5
-48
lines changed

1 file changed

+5
-48
lines changed

01_P/P_2_3_3_01_TABLET_TOOL/P_2_3_3_01_TABLET_TOOL.pde

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void keyReleased() {
168168
}
169169

170170
if (key == 'z' || key == 'Z') {
171-
undoDrawItems(undoIndex);
171+
undoIndex = undoDrawItems(undoIndex);
172172
reDrawAllDrawItems();
173173
}
174174
}
@@ -198,56 +198,13 @@ void reDrawAllDrawItems() {
198198
}
199199
}
200200

201-
void undoDrawItems(int theUndoIndex) {
201+
int undoDrawItems(int theUndoIndex) {
202202
theUndoIndex -= 1;
203203
if (drawItems.size() > 0 && theUndoIndex >= 0) {
204204
for (int i = drawItems.size()-1; i > theUndoIndex; i--) {
205205
drawItems.remove(i);
206206
}
207207
}
208-
}
209-
210-
211-
212-
213-
214-
215-
216-
217-
218-
219-
220-
221-
222-
223-
224-
225-
226-
227-
228-
229-
230-
231-
232-
233-
234-
235-
236-
237-
238-
239-
240-
241-
242-
243-
244-
245-
246-
247-
248-
249-
250-
251-
252-
253-
208+
209+
return theUndoIndex;
210+
}

0 commit comments

Comments
 (0)