From fbd3a309bac74fa5b7384f536590f1f2a9d69f72 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 May 2015 01:29:02 -0400 Subject: change erase mode color --- js/ui/brush.js | 5 +++-- js/ui/controls.js | 2 +- js/ui/palette.js | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'js/ui') diff --git a/js/ui/brush.js b/js/ui/brush.js index 4cf7495..f05d6cc 100644 --- a/js/ui/brush.js +++ b/js/ui/brush.js @@ -29,9 +29,10 @@ var brush = (function(){ dragging = true erasing = (e.which == "3" || e.ctrlKey) if (erasing) { - lex.clear() + lex.erase() } else { + fillColor = brush.bg lex.fill(brush.fg, brush.bg) } lex.focus() @@ -43,7 +44,7 @@ var brush = (function(){ } erasing = (e.which == "3" || e.ctrlKey) if (erasing) { - lex.clear() + lex.erase() } else { lex.fill(brush.fg, brush.bg) diff --git a/js/ui/controls.js b/js/ui/controls.js index 9ea58f5..8293a32 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -87,7 +87,7 @@ var controls = (function(){ controls.clear = new Tool (clear_el) controls.clear.use = function(){ - canvas.clear() + canvas.erase() } controls.grid = new Checkbox (grid_el) diff --git a/js/ui/palette.js b/js/ui/palette.js index 04f56c2..e03e17b 100644 --- a/js/ui/palette.js +++ b/js/ui/palette.js @@ -21,6 +21,9 @@ var palette = (function(){ if (! brush.modified) { brush.generate() } + if (filling) { + fillColor = lex.bg + } }) }) -- cgit v1.2.3-70-g09d2