2017-11-04 19:59:11 -04:00
|
|
|
function Path_Line(from,to,end = null)
|
|
|
|
{
|
|
|
|
this.from = from;
|
|
|
|
this.to = to;
|
|
|
|
this.end = end;
|
|
|
|
|
|
|
|
this.to_segment = function(prev)
|
|
|
|
{
|
|
|
|
var html = ""
|
|
|
|
|
2017-11-05 14:15:31 -05:00
|
|
|
if(!prev || (!prev.to && !prev.end)){
|
2017-11-04 19:59:11 -04:00
|
|
|
html += "M"+this.from+" ";
|
|
|
|
}
|
|
|
|
else if(prev){
|
2017-11-05 00:33:04 -04:00
|
|
|
if(prev.end){
|
|
|
|
if(!prev.end.is_equal(this.from)){
|
|
|
|
html += "M"+this.from+" ";
|
|
|
|
}
|
2017-11-04 19:59:11 -04:00
|
|
|
}
|
2017-11-05 00:33:04 -04:00
|
|
|
else if(prev.to){
|
|
|
|
if(!prev.to.is_equal(this.from)){
|
|
|
|
html += "M"+this.from+" ";
|
|
|
|
}
|
2017-11-04 19:59:11 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
html += "L"+this.to+" "
|
|
|
|
|
|
|
|
if(this.end){
|
|
|
|
html += "L"+this.end+" "
|
|
|
|
}
|
|
|
|
|
|
|
|
return html
|
|
|
|
}
|
|
|
|
}
|