summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-12-11 12:58:32 -0500
committerJules Laplace <jules@okfoc.us>2014-12-11 12:58:32 -0500
commit66488f43e9c19e3c286ff93c051af21ce01c5b86 (patch)
tree49effa0d51c22dd4a5eb56e7f443b063660083ce /js
parent151db2336cce17e7623a9e105799e72bc842e7fe (diff)
shift-click to draw a straight line
Diffstat (limited to 'js')
-rw-r--r--js/ui/canvas.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/ui/canvas.js b/js/ui/canvas.js
index e36f1b5..7e75ef6 100644
--- a/js/ui/canvas.js
+++ b/js/ui/canvas.js
@@ -26,7 +26,12 @@ var canvas = current_canvas = (function(){
current_canvas = canvas
if (drawing) {
erasing = (e.which == "3" || e.ctrlKey)
- draw(lex, x, y, erasing)
+ if (e.shiftKey) {
+ line(lex, last_point, point, erasing)
+ }
+ else {
+ draw(lex, x, y, erasing)
+ }
last_point[0] = x
last_point[1] = y
}