From a0b65f2e1a81b6fec30b4c1c2b2764c8dbcd64a9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 12 Dec 2014 00:05:37 -0500 Subject: flood fill --- js/ui/controls.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'js/ui/controls.js') diff --git a/js/ui/controls.js b/js/ui/controls.js index 293cd1d..bbf93cc 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -7,6 +7,7 @@ var controls = (function(){ brush.generate = controls.circle.generate brush.generate() drawing = true + filling = false selection.hide() brush.modified = false } @@ -30,6 +31,7 @@ var controls = (function(){ brush.generate() brush.modified = false drawing = true + filling = false selection.hide() } controls.square.generate = function(){ @@ -42,6 +44,7 @@ var controls = (function(){ brush.generate = controls.text.generate brush.generate() drawing = false + filling = false selection.hide() } controls.text.generate = function(){ @@ -50,9 +53,15 @@ var controls = (function(){ controls.select = new Tool (select_el) controls.select.use = function(){ drawing = false + filling = false selection.show() } - controls.text.generate = function(){ + + controls.fill = new Tool (fill_el) + controls.fill.use = function(){ + drawing = false + filling = true + selection.hide() } controls.clear = new Tool (clear_el) @@ -137,6 +146,7 @@ var controls = (function(){ controls.square, controls.circle, controls.text, + controls.fill, controls.select, controls.clear, controls.grid, -- cgit v1.2.3-70-g09d2