Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

undo functionality fixes

  • Loading branch information...
commit f4fb97b551728e4b9c6edb6b6ae7e616392fbd60 1 parent b732eac
@mohanrohith authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 canvas.js
View
12 canvas.js
@@ -148,10 +148,12 @@ DAP.undo = function(){
var index = Draw.state.undo.length,
num = Draw.state.undo[index-1] - Draw.state.undo[index-2];
- for(var arr in Draw.state.draw){
- Draw.state.draw[arr].splice(Draw.state.undo[index-2],num);
- }
+ if(Draw.state.draw.clickX.length >0){
+ for(var arr in Draw.state.draw){
+ Draw.state.draw[arr].splice(Draw.state.undo[index-2],num);
+ }
- Draw.state.undo.pop();
- this.redraw();
+ Draw.state.undo.pop();
+ this.redraw();
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.