Merge pull request #6 from jrc03c/master

Fixed the `draw_line` function.
This commit is contained in:
Лu Лinveгa 2017-11-06 18:35:05 +13:00 committed by GitHub
commit 1cb318a9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();