summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-05-05 03:56:25 -0400
committerJules Laplace <jules@okfoc.us>2015-05-05 03:56:25 -0400
commit3d1715a97992074f3262b84d266f7611696ac7e6 (patch)
tree58c6c32c080fb063490b089bc3154b83b59bb526
parentfb1fe27e305a60870ba285445571d2277f959c7c (diff)
fixie
-rw-r--r--js/draw.js6
-rw-r--r--js/ui/canvas.js3
2 files changed, 8 insertions, 1 deletions
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) {