aboutsummaryrefslogtreecommitdiff
path: root/tools/draw/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/draw/app.js')
-rw-r--r--tools/draw/app.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/draw/app.js b/tools/draw/app.js
index 329a8fc..4c73d75 100644
--- a/tools/draw/app.js
+++ b/tools/draw/app.js
@@ -57,17 +57,16 @@ window.addEventListener('load', function(evt) {
57 ctx.lineWidth = parseInt(button.dataset.value); 57 ctx.lineWidth = parseInt(button.dataset.value);
58 break; 58 break;
59 } 59 }
60 case 'clear':
61 {
62 let clear = confirm('Do you really want to clear canvas?');
63 if (clear) {
64 ctx.clearRect(0, 0, canvas.width, canvas.height);
65 }
66 break;
67 }
68 } 60 }
69 }); 61 });
70 62
71 }); 63 });
72 64
65 document.addEventListener('keydown', function(evt) {
66 if (evt.keyCode == 8) {
67 ctx.clearRect(0, 0, canvas.width, canvas.height);
68 }
69 console.log(evt.keyCode);
70 }, false);
71
73}); 72});