Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

undo functionality fixes

  • Loading branch information...
commit f4fb97b551728e4b9c6edb6b6ae7e616392fbd60 1 parent b732eac
Rohith Mohan authored

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. +7 5 canvas.js
12 canvas.js
@@ -148,10 +148,12 @@ DAP.undo = function(){
148 148 var index = Draw.state.undo.length,
149 149 num = Draw.state.undo[index-1] - Draw.state.undo[index-2];
150 150
151   - for(var arr in Draw.state.draw){
152   - Draw.state.draw[arr].splice(Draw.state.undo[index-2],num);
153   - }
  151 + if(Draw.state.draw.clickX.length >0){
  152 + for(var arr in Draw.state.draw){
  153 + Draw.state.draw[arr].splice(Draw.state.undo[index-2],num);
  154 + }
154 155
155   - Draw.state.undo.pop();
156   - this.redraw();
  156 + Draw.state.undo.pop();
  157 + this.redraw();
  158 + }
157 159 }

0 comments on commit f4fb97b

Please sign in to comment.
Something went wrong with that request. Please try again.