diff options
Diffstat (limited to 'js/ui/brush.js')
| -rw-r--r-- | js/ui/brush.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/ui/brush.js b/js/ui/brush.js new file mode 100644 index 0000000..1b01081 --- /dev/null +++ b/js/ui/brush.js @@ -0,0 +1,27 @@ +var brush = (function(){ + var brush = new Matrix (5, 5, function(x,y){ + var lex = new Lex (x,y) + lex.build() + return lex + }) + + brush.bind = function(){ + brush.forEach(function(lex, x, y){ + if (lex.bound) return + lex.bound = true + + lex.span.addEventListener('mousedown', function(e){ + e.preventDefault() + dragging = true + // lex.fill(lex.fg, lex.bg) + }) + + }) + } + + brush.fg = 0 + brush.bg = 1 + + return brush + +})()
\ No newline at end of file |
