Prevent some accidental drawing.
Fix undo before drawing anything.