Fixed mirror
This commit is contained in:
parent
e7d12ca2a7
commit
1e9f2013f7
@ -290,12 +290,14 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
|
|||||||
|
|
||||||
this.preview = function(operation)
|
this.preview = function(operation)
|
||||||
{
|
{
|
||||||
if(!operation){ return `<path></path>`;}
|
if(!operation){ return `<path d='M0,0'></path>`;}
|
||||||
if(operation != "line" && operation != "arc_c" && operation != "arc_r" && operation != "bezier" && operation != "close"){ return `<path></path>`; }
|
if(operation != "line" && operation != "arc_c" && operation != "arc_r" && operation != "bezier" && operation != "close"){ return `<path d='M0,0'></path>`; }
|
||||||
|
|
||||||
this.preview_el.innerHTML = `<path d='${dotgrid.tool.path([{type:operation,verteces:dotgrid.tool.verteces}])}'></path>`;
|
this.preview_el.innerHTML = `<path d='${dotgrid.tool.path([{type:operation,verteces:dotgrid.tool.verteces}])}'></path>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggles
|
||||||
|
|
||||||
this.mod_thickness = function(mod,step = false)
|
this.mod_thickness = function(mod,step = false)
|
||||||
{
|
{
|
||||||
if(!mod){ mod = 1; this.thickness = this.thickness > 30 ? 1 : this.thickness }
|
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)
|
this.draw = function(exp = false)
|
||||||
{
|
{
|
||||||
var d = "";
|
var d = this.tool.path();
|
||||||
var prev = "";
|
this.path.setAttribute("d",d);
|
||||||
for(id in this.segments){
|
|
||||||
var segment = this.segments[id];
|
|
||||||
d += segment.to_segment(prev)+" ";
|
|
||||||
prev = segment;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.path.setAttribute("d",this.tool.path());
|
|
||||||
|
|
||||||
this.svg_el.style.width = this.width;
|
this.svg_el.style.width = this.width;
|
||||||
this.svg_el.style.height = this.height;
|
this.svg_el.style.height = this.height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user