summaryrefslogtreecommitdiff
path: root/js/ui
diff options
context:
space:
mode:
Diffstat (limited to 'js/ui')
-rw-r--r--js/ui/brush.js4
-rw-r--r--js/ui/canvas.js2
-rw-r--r--js/ui/controls.js3
3 files changed, 6 insertions, 3 deletions
diff --git a/js/ui/brush.js b/js/ui/brush.js
index 8cc858f..668538f 100644
--- a/js/ui/brush.js
+++ b/js/ui/brush.js
@@ -41,7 +41,7 @@ var brush = (function(){
}
else {
fillColor = brush.bg
- lex.fill(brush)
+ lex.assign(brush)
}
brush.focus(x, y)
})
@@ -55,7 +55,7 @@ var brush = (function(){
lex.clear()
}
else {
- lex.fill(brush)
+ lex.assign(brush)
}
brush.focus(x, y)
})
diff --git a/js/ui/canvas.js b/js/ui/canvas.js
index e241fd1..75b8f97 100644
--- a/js/ui/canvas.js
+++ b/js/ui/canvas.js
@@ -52,6 +52,8 @@ var canvas = current_canvas = (function(){
})
lex.span.addEventListener("mousemove", function(e){
+ mouse.x = x
+ mouse.y = y
if (is_mobile) return
if (! dragging) return
if (drawing) {
diff --git a/js/ui/controls.js b/js/ui/controls.js
index a21e293..c191cc2 100644
--- a/js/ui/controls.js
+++ b/js/ui/controls.js
@@ -72,6 +72,7 @@ var controls = (function(){
undo.new()
undo.save_rect(0, 0, canvas.w, canvas.h)
canvas.erase()
+ current_filetool && current_filetool.blur()
}
controls.webcam = new FileTool (webcam_el)
@@ -119,9 +120,9 @@ var controls = (function(){
})
controls.save = new ClipboardTool (save_el)
controls.save.use = function(){
+ changed && clipboard.upload_png()
clipboard.show()
clipboard.export_mode()
- clipboard.upload_png()
}
controls.load = new ClipboardTool (load_el)
controls.load.use = function(){