Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 5 additions & 48 deletions 01_P/P_2_3_3_01_TABLET_TOOL/P_2_3_3_01_TABLET_TOOL.pde
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void keyReleased() {
}

if (key == 'z' || key == 'Z') {
undoDrawItems(undoIndex);
undoIndex = undoDrawItems(undoIndex);
reDrawAllDrawItems();
}
}
Expand Down Expand Up @@ -198,56 +198,13 @@ void reDrawAllDrawItems() {
}
}

void undoDrawItems(int theUndoIndex) {
int undoDrawItems(int theUndoIndex) {
theUndoIndex -= 1;
if (drawItems.size() > 0 && theUndoIndex >= 0) {
for (int i = drawItems.size()-1; i > theUndoIndex; i--) {
drawItems.remove(i);
}
}
}














































return theUndoIndex;
}