summaryrefslogtreecommitdiff
path: root/js/blit.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-05-06 01:57:11 -0400
committerJules Laplace <jules@okfoc.us>2015-05-06 01:57:11 -0400
commitf650127c109fb65a589388cefb51eb990b151612 (patch)
tree026bbb4921cd103b4eec3636393f537c6e903299 /js/blit.js
parent05f454468e71d61ae4f0674223066efa118955b0 (diff)
experimental palette
Diffstat (limited to 'js/blit.js')
-rw-r--r--js/blit.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/blit.js b/js/blit.js
index ac8cb42..367d67b 100644
--- a/js/blit.js
+++ b/js/blit.js
@@ -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
})()