summaryrefslogtreecommitdiff
path: root/js/lex.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lex.js')
-rw-r--r--js/lex.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/lex.js b/js/lex.js
index 8c3b0f1..bfc8e8e 100644
--- a/js/lex.js
+++ b/js/lex.js
@@ -17,7 +17,7 @@ Lex.prototype.build = function(){
this.span.innerHTML = this.html()
}
Lex.prototype.css = function(){
- if (this.opacity == 0) return "fabb"
+ if (this.opacity == 0 && ! this.char) return "fabb"
return "f" + letters[mod(this.fg,16)] + "b" + letters[mod(this.bg,16)]
}
Lex.prototype.html = function(){
@@ -57,6 +57,14 @@ Lex.prototype.clone = function (lex){
this.opacity = lex.opacity
this.build()
}
+Lex.prototype.paint = function (lex){
+ if (lex.opacity == 0) return
+ if (brush.draw_fg) this.fg = lex.fg
+ if (brush.draw_bg) this.bg = lex.bg
+ if (brush.draw_char) this.char = lex.char
+ this.opacity = 1
+ this.build()
+}
Lex.prototype.copy = function () {
var lex = new Lex (0,0)
lex.clone(this)
@@ -108,6 +116,6 @@ Lex.prototype.demolish = function(){
Lex.prototype.key = function(char, keyCode) {
if (! char) { return }
this.char = char
- this.fg = brush.bg
+ this.fg = brush.fg
this.build()
}