diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-05-05 03:12:24 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-05-05 03:12:24 -0400 |
| commit | 1908b82d0bfa01267e623636b5bd0aca82a6ce82 (patch) | |
| tree | 5e925da250930cec2c6bb623313ed6211c2ff626 /js/ui/controls.js | |
| parent | f07fd39e67df3618c97dd38480488e62ca91ef9e (diff) | |
bucket
Diffstat (limited to 'js/ui/controls.js')
| -rw-r--r-- | js/ui/controls.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js index 3f92b08..982871a 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -8,7 +8,6 @@ var controls = (function(){ brush.generate() drawing = true filling = false - selection.hide() brush.modified = false } controls.cross.generate = function(){ @@ -27,8 +26,6 @@ var controls = (function(){ brush.generate = controls.circle.generate brush.generate() drawing = true - filling = false - selection.hide() brush.modified = false } controls.circle.generate = function(){ @@ -44,6 +41,9 @@ var controls = (function(){ } }) } + controls.circle.done = function(){ + drawing = false + } controls.square = new Tool (square_el) controls.square.use = function(){ @@ -51,37 +51,39 @@ var controls = (function(){ brush.generate() brush.modified = false drawing = true - filling = false - selection.hide() } controls.square.generate = function(){ var fg = brush.fg, bg = brush.bg brush.fill(fg,bg) } + controls.square.done = function(){ + drawing = false + } controls.text = new Tool (text_el) controls.text.use = function(){ brush.generate = controls.text.generate brush.generate() - drawing = false - filling = false - selection.hide() } controls.text.generate = function(){ } controls.select = new Tool (select_el) controls.select.use = function(){ - drawing = false - filling = false selection.show() } + controls.select.done = function(){ + selection.hide() + } controls.fill = new Tool (fill_el) controls.fill.use = function(){ - drawing = false filling = true - selection.hide() + document.body.classList.add("bucket") + } + controls.fill.done = function(){ + filling = false + document.body.classList.remove("bucket") } controls.clear = new Tool (clear_el) @@ -91,7 +93,6 @@ var controls = (function(){ controls.grid = new Checkbox (grid_el) controls.grid.use = function(){ - selection.hide() document.body.classList.toggle('grid') this.update( document.body.classList.contains("grid") ) } |
