diff --git a/sources/scripts/dotgrid.js b/sources/scripts/dotgrid.js index 9d8f4d2..0a2a88e 100644 --- a/sources/scripts/dotgrid.js +++ b/sources/scripts/dotgrid.js @@ -314,8 +314,12 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.erase = function() { - this.reset(); - this.segments.pop(); + if(from || to || end){ + this.reset(); + } + else{ + this.segments.pop(); + } this.draw(); } diff --git a/sources/scripts/path_arc.js b/sources/scripts/path_arc.js index 9beb633..ee3d71b 100644 --- a/sources/scripts/path_arc.js +++ b/sources/scripts/path_arc.js @@ -9,7 +9,7 @@ function Path_Arc(from,to,orientation,end) { var html = "" - if(!prev){ + if(!prev || (!prev.to && !prev.end)){ html += "M"+this.from+" "; } else if(prev){ diff --git a/sources/scripts/path_bezier.js b/sources/scripts/path_bezier.js index ec02cce..e070884 100644 --- a/sources/scripts/path_bezier.js +++ b/sources/scripts/path_bezier.js @@ -8,7 +8,7 @@ function Path_Bezier(from,to,end) { var html = "" - if(!prev){ + if(!prev || (!prev.to && !prev.end)){ html += "M"+this.from+" "; } else if(prev){ diff --git a/sources/scripts/path_line.js b/sources/scripts/path_line.js index ceee600..3bddef7 100644 --- a/sources/scripts/path_line.js +++ b/sources/scripts/path_line.js @@ -8,7 +8,7 @@ function Path_Line(from,to,end = null) { var html = "" - if(!prev){ + if(!prev || (!prev.to && !prev.end)){ html += "M"+this.from+" "; } else if(prev){