Fixed issue with beziers

This commit is contained in:
Devine Lu Linvega 2017-11-05 17:58:53 +13:00
parent 0a617dbd02
commit c352cf2575
3 changed files with 19 additions and 10 deletions

View File

@ -98,10 +98,11 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
var o = e.target.getAttribute("data-operation");
if(!o){ return; }
console.log(o)
if(o == "line"){ this.draw_line(); }
if(o == "arc_c"){ this.draw_arc("0,1"); }
if(o == "arc_r"){ this.draw_line("0,0"); }
if(o == "bezier"){ this.draw_line(); }
if(o == "arc_r"){ this.draw_arc("0,0"); }
if(o == "bezier"){ this.draw_bezier(); }
if(o == "export"){ this.export(); }
}

View File

@ -13,11 +13,15 @@ function Path_Arc(from,to,orientation,end)
html += "M"+this.from+" ";
}
else if(prev){
if(prev.end && !prev.end.is_equal(this.from)){
html += "M"+this.from+" ";
if(prev.end){
if(!prev.end.is_equal(this.from)){
html += "M"+this.from+" ";
}
}
else if(prev.to && !prev.to.is_equal(this.from)){
html += "M"+this.from+" ";
else if(prev.to){
if(!prev.to.is_equal(this.from)){
html += "M"+this.from+" ";
}
}
}

View File

@ -12,11 +12,15 @@ function Path_Bezier(from,to,end)
html += "M"+this.from+" ";
}
else if(prev){
if(prev.end && !prev.end.is_equal(this.from)){
html += "M"+this.from+" ";
if(prev.end){
if(!prev.end.is_equal(this.from)){
html += "M"+this.from+" ";
}
}
else if(prev.to && !prev.to.is_equal(this.from)){
html += "M"+this.from+" ";
else if(prev.to){
if(!prev.to.is_equal(this.from)){
html += "M"+this.from+" ";
}
}
}