diff options
Diffstat (limited to 'js/blit.js')
| -rw-r--r-- | js/blit.js | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -47,5 +47,22 @@ var blit = (function(){ } }) } + blit.circle = function(A, lex){ + var hw = brush.w/2|0, hh = brush.h/2|0 + A.forEach(function(lex,x,y) { + var len = Math.sqrt(Math.pow(x-hw,2)+Math.pow(y-hh,2)) + if (len > Math.abs(hw)) { + lex.clear() + } + }) + } + blit.cross = function(A, lex){ + A.forEach(function(lex,x,y) { + if ((x+y)%2) { + lex.clear() + } + }) + } + return blit })() |
