blob: 1b01081747f0cb333482a8d975c337276c440bec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
})()
|