Undo/Redo Drawing

Demonstrates the use of undo & redo methods while drawing.

Use Ctrl-Z or ⌘-Z to undo while drawing. Use Ctrl-Y or ⌘-Y to redo what you have undone. Use Esc to cancel the current sketch.

The control.undo method works on the current sketch, removing the most recently added point. The control.redo method adds back items that were removed from an undo. To fully erase a sketch, call the control.cancel method.

View the draw-undo-redo.js source to see how this is done.