From 3d1715a97992074f3262b84d266f7611696ac7e6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 May 2015 03:56:25 -0400 Subject: fixie --- js/draw.js | 6 ++++++ js/ui/canvas.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/draw.js b/js/draw.js index 4de9980..f12fbe9 100644 --- a/js/draw.js +++ b/js/draw.js @@ -16,6 +16,11 @@ var draw = (function(){ last_point[1] = point[1] } + function set_last_point (e, point) { + last_point[0] = point[0] + last_point[1] = point[1] + } + function move (e, lex, point) { line(lex, last_point, point, erasing) last_point[0] = point[0] @@ -97,6 +102,7 @@ var draw = (function(){ var draw = {} draw.down = down + draw.set_last_point = set_last_point draw.move = move draw.stamp = stamp draw.line = line diff --git a/js/ui/canvas.js b/js/ui/canvas.js index 0f92af4..059b24c 100644 --- a/js/ui/canvas.js +++ b/js/ui/canvas.js @@ -26,12 +26,13 @@ var canvas = current_canvas = (function(){ if (e.altKey) { if (e.shiftKey) { blit.copy_from(canvas, brush, floor(x-brush.w/2), floor(y-brush.h/2)) + draw.set_last_point(e, point) } else { brush.assign(lex) brush.generate() + dragging = false } - dragging = false return } else if (drawing) { -- cgit v1.2.3-70-g09d2