diff --git a/sources/scripts/dotgrid.js b/sources/scripts/dotgrid.js index cd751e1..911a1ea 100644 --- a/sources/scripts/dotgrid.js +++ b/sources/scripts/dotgrid.js @@ -290,12 +290,14 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.preview = function(operation) { - if(!operation){ return ``;} - if(operation != "line" && operation != "arc_c" && operation != "arc_r" && operation != "bezier" && operation != "close"){ return ``; } + if(!operation){ return ``;} + if(operation != "line" && operation != "arc_c" && operation != "arc_r" && operation != "bezier" && operation != "close"){ return ``; } this.preview_el.innerHTML = ``; } + // Toggles + this.mod_thickness = function(mod,step = false) { if(!mod){ mod = 1; this.thickness = this.thickness > 30 ? 1 : this.thickness } @@ -369,15 +371,8 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.draw = function(exp = false) { - var d = ""; - var prev = ""; - for(id in this.segments){ - var segment = this.segments[id]; - d += segment.to_segment(prev)+" "; - prev = segment; - } - - this.path.setAttribute("d",this.tool.path()); + var d = this.tool.path(); + this.path.setAttribute("d",d); this.svg_el.style.width = this.width; this.svg_el.style.height = this.height;