Fixed the draw_line function.

This commit is contained in:
Josh Castle 2017-11-05 22:35:29 -06:00
parent fd34a91758
commit 01483dddcc

View File

@ -248,11 +248,12 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
{
if(from === null || to === null){ return; }
var end_point = end ? new Pos(end[0] * -1,end[1]) : null;
to = new Pos(to[0] * -1, to[1])
var end_point = end ? new Pos(end[0] * -1,end[1]) : to;
from = new Pos(from[0],from[1])
from = new Pos(from[0] * -1,from[1])
this.segments.push(new Path_Line(new Pos(from.x * -1,from.y).sub(this.offset),new Pos(to[0] * -1,to[1]).sub(this.offset),end_point.sub(this.offset)));
this.segments.push(new Path_Line(from.sub(this.offset),to.sub(this.offset),end_point.sub(this.offset)));
this.draw();
reset();