Undo first removes control points

This commit is contained in:
Devine Lu Linvega 2017-11-06 08:15:31 +13:00
parent cb0d2edb1d
commit 0e32be5314
4 changed files with 9 additions and 5 deletions

View File

@ -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();
}

View File

@ -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){

View File

@ -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){

View File

@ -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){