Removed last
This commit is contained in:
parent
148fffa73e
commit
78a61e099b
@ -20,7 +20,7 @@ function Generator(layer)
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.render = function(last_seg,segment,mirror = 0)
|
this.render = function(segment,mirror = 0)
|
||||||
{
|
{
|
||||||
var type = segment.type;
|
var type = segment.type;
|
||||||
var vertices = segment.vertices;
|
var vertices = segment.vertices;
|
||||||
@ -31,7 +31,6 @@ function Generator(layer)
|
|||||||
if(skip > 0){ skip -= 1; continue; }
|
if(skip > 0){ skip -= 1; continue; }
|
||||||
|
|
||||||
var vertex = vertices[id]
|
var vertex = vertices[id]
|
||||||
var last = last_seg && last_seg.vertices[last_seg.vertices.length-1] ? last_seg.vertices[last_seg.vertices.length-1] : null
|
|
||||||
var next = vertices[parseInt(id)+1]
|
var next = vertices[parseInt(id)+1]
|
||||||
var after_next = vertices[parseInt(id)+2]
|
var after_next = vertices[parseInt(id)+2]
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ function Generator(layer)
|
|||||||
var s = ""
|
var s = ""
|
||||||
for(id in layer){
|
for(id in layer){
|
||||||
var seg = layer[id];
|
var seg = layer[id];
|
||||||
s += `${this.render(layer[id-1],seg,mirror)}`
|
s += `${this.render(seg,mirror)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
@ -67,6 +67,9 @@ function Tool()
|
|||||||
{
|
{
|
||||||
if(!dot.layers || dot.layers.length != 3){ console.warn("Incompatible version"); return; }
|
if(!dot.layers || dot.layers.length != 3){ console.warn("Incompatible version"); return; }
|
||||||
|
|
||||||
|
if(dot.settings.width && dot.settings.height){
|
||||||
|
dot.settings.size = {width:dot.settings.width,height:dot.settings.height}
|
||||||
|
}
|
||||||
if(this.settings && (this.settings.size.width != dot.settings.size.width || this.settings.size.height != dot.settings.size.height)){
|
if(this.settings && (this.settings.size.width != dot.settings.size.width || this.settings.size.height != dot.settings.size.height)){
|
||||||
dotgrid.set_size({width:dot.settings.size.width,height:dot.settings.size.height})
|
dotgrid.set_size({width:dot.settings.size.width,height:dot.settings.size.height})
|
||||||
}
|
}
|
||||||
@ -161,6 +164,7 @@ function Tool()
|
|||||||
for(id in this.layer()){
|
for(id in this.layer()){
|
||||||
var stroke = this.layer()[id];
|
var stroke = this.layer()[id];
|
||||||
if(stroke.type != content.type){ continue; }
|
if(stroke.type != content.type){ continue; }
|
||||||
|
if(!stroke.vertices){ continue; }
|
||||||
if(!stroke.vertices[stroke.vertices.length-1]){ continue; }
|
if(!stroke.vertices[stroke.vertices.length-1]){ continue; }
|
||||||
if(stroke.vertices[stroke.vertices.length-1].x != content.vertices[0].x){ continue; }
|
if(stroke.vertices[stroke.vertices.length-1].x != content.vertices[0].x){ continue; }
|
||||||
if(stroke.vertices[stroke.vertices.length-1].y != content.vertices[0].y){ continue; }
|
if(stroke.vertices[stroke.vertices.length-1].y != content.vertices[0].y){ continue; }
|
||||||
|
Loading…
Reference in New Issue
Block a user