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

@ -246,16 +246,17 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
// Draw // Draw
this.draw_line = function() this.draw_line = function()
{ {
if(from === null || to === null){ return; } 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(); this.draw();
reset(); reset();
} }
this.draw_arc = function(orientation) this.draw_arc = function(orientation)