From f9d8109c1ef27ab337889194f8d57be0fb86cbf4 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 5 Aug 2018 07:56:13 +1200 Subject: [PATCH] Can append to lines --- desktop/sources/scripts/cursor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop/sources/scripts/cursor.js b/desktop/sources/scripts/cursor.js index ffd7558..57759c1 100644 --- a/desktop/sources/scripts/cursor.js +++ b/desktop/sources/scripts/cursor.js @@ -57,14 +57,14 @@ function Cursor() if(e.altKey){ dotgrid.tool.remove_segments_at(this.pos); this.translate(); return; } - // Translation - if(this.translation){ + if(this.translation && !is_equal(this.translation.from,this.translation.to)){ if(this.translation.multi){ dotgrid.tool.translate_multi(this.translation.from,this.translation.to); } else{ dotgrid.tool.translate(this.translation.from,this.translation.to); } } else if(e.target.id == "guide"){ dotgrid.tool.add_vertex({x:this.pos.x,y:this.pos.y}); } + this.translate(); dotgrid.interface.refresh(); @@ -105,4 +105,6 @@ function Cursor() y:clamp(step(pos.y,grid),grid,dotgrid.tool.settings.size.height+grid) }; } + + function is_equal(a,b){ return a.x == b.x && a.y == b.y; } } \ No newline at end of file