From 94ee178000e256dc41438cf4d867e1bced09563e Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Mon, 18 May 2015 18:26:54 +0200 Subject: fix brush loading + erasing --- js/lex.js | 2 +- js/ui/brush.js | 6 +++--- js/ui/canvas.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/lex.js b/js/lex.js index c68d0e0..b554d85 100644 --- a/js/lex.js +++ b/js/lex.js @@ -95,7 +95,7 @@ Lex.prototype.ne = function(lex){ return ! this.eq(lex) } Lex.prototype.clear = function(){ - this.bg = fillColor + this.bg = colors.black this.fg = 0 this.char = " " this.opacity = 0 diff --git a/js/ui/brush.js b/js/ui/brush.js index 53c0e46..4b2db3c 100644 --- a/js/ui/brush.js +++ b/js/ui/brush.js @@ -29,7 +29,7 @@ var brush = (function(){ dragging = true erasing = (e.which == "3" || e.ctrlKey) if (erasing) { - lex.erase() + lex.clear() } else { fillColor = brush.bg @@ -44,7 +44,7 @@ var brush = (function(){ } erasing = (e.which == "3" || e.ctrlKey) if (erasing) { - lex.erase() + lex.clear() } else { lex.fill(brush) @@ -69,7 +69,7 @@ var brush = (function(){ this.expand(-i) } - brush.assign = function(lex){ + brush.load = function(lex){ brush.char = lex.char brush.fg = lex.fg brush.bg = lex.bg diff --git a/js/ui/canvas.js b/js/ui/canvas.js index 75131c1..62bd4c3 100644 --- a/js/ui/canvas.js +++ b/js/ui/canvas.js @@ -29,7 +29,7 @@ var canvas = current_canvas = (function(){ draw.set_last_point(e, point) } else { - brush.assign(lex) + brush.load(lex) brush.generate() dragging = false } -- cgit v1.2.3-70-g09d2