diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-11-22 01:21:35 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-11-22 01:21:35 -0500 |
| commit | 69e0de28cb98b90d630c76d25f483ba59802d1d2 (patch) | |
| tree | 909cddfeb49fc45072efc94d14af3813e39d44d2 /js/app.js | |
| parent | a33bb28019c25fd885bb6fe5402fc87a2dc04829 (diff) | |
big shader thing
Diffstat (limited to 'js/app.js')
| -rw-r--r-- | js/app.js | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1,7 +1,7 @@ var contentType = 'text/plain;charset=utf-8' -var cols = 10 -var rows = 5 +var cols = 200 +var rows = 200 var dragging = false var drawing = true var erasing = false @@ -37,7 +37,6 @@ function build () { }) palette = new Matrix (32, 2, function(x,y){ var lex = new Lex (x,y) - console.log(color_hue_order[y>>1]) lex.bg = colors[color_hue_order[y>>1]] lex.build() return lex @@ -172,18 +171,26 @@ function bind () { }) controls.canvas_width.key = int_key(function(n, keyCode){ + if (controls.canvas_width.char.length == 1) { + n = parseInt(controls.canvas_width.char) * 10 + n + } controls.canvas_width.blur() controls.canvas_width.char = ""+n controls.canvas_width.build() - brush.w = n - brush.rebuild() + canvas.w = n + canvas.rebuild() }) controls.canvas_height.key = int_key(function(n, keyCode){ + console.log(controls.canvas_height.char.length) + console.log(controls.canvas_height.char,n) + if (controls.canvas_height.char.length == 1) { + n = parseInt(controls.canvas_height.char) * 10 + n + } controls.canvas_height.blur() controls.canvas_height.char = ""+n controls.canvas_height.build() - brush.h = n - brush.rebuild() + canvas.h = n + canvas.rebuild() }) window.addEventListener('keydown', function(e){ |
