diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-25 14:11:10 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-25 14:11:10 -0400 |
| commit | d24f166d20d093335c25a0f4d99f51555bbd2439 (patch) | |
| tree | 2dc714a555153d12867d9033115e685c5206376e /js | |
| parent | 68db15310ee74e4b13d9af650c75b7ccae7ed96d (diff) | |
cross brush
Diffstat (limited to 'js')
| -rw-r--r-- | js/ui/controls.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js index 2f98398..661f881 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -2,6 +2,27 @@ var controls = (function(){ var controls = {} + controls.cross = new Tool (cross_el) + controls.cross.use = function(){ + brush.generate = controls.cross.generate + brush.generate() + drawing = true + filling = false + selection.hide() + brush.modified = false + } + controls.cross.generate = function(){ + var fg = brush.fg, bg = brush.bg + brush.forEach(function(lex,x,y) { + if ((x+y)%2) { + lex.clear() + } + else { + lex.fill(fg,bg) + } + }) + } + controls.circle = new Tool (circle_el) controls.circle.use = function(){ brush.generate = controls.circle.generate @@ -168,6 +189,7 @@ var controls = (function(){ [ controls.square, controls.circle, + controls.cross, controls.text, controls.fill, controls.select, |
