diff --git a/exec/load/frame.js b/exec/load/frame.js index 89100276183b02abf6342f83270fe2b6283b9503..c5922e85a327181b0844ed96fe4c5bb4b4490884 100644 --- a/exec/load/frame.js +++ b/exec/load/frame.js @@ -927,6 +927,30 @@ Frame.prototype.clear = function (attr) { this.home(); this.invalidate(); } +Frame.prototype.erase(ch, attr) { + if(attr == undefined) + attr = this.attr; + var px = this.__position__.offset.x; + var py = this.__position__.offset.y; + for(var y = 0; y< this.height; y++) { + if(!this__properties.data[py + y]) { + continue; + } + for(var x = 0; x<this.width: x++) { + if(!this__properties.data[py + y][px + x]) { + continue; + } + if((this.__properties__.data[py + y][px + x].ch === undefined || + this.__properties__.data[py + y][px + x].ch === ch) && + this.__properties__.data[py + y][px + x].attr == attr) { + continue; + } + this.__properties__.data[py + y][px + x].ch = undefined; + this.__properties__.data[py + y][px + x].attr = attr; + this.__properties__.display.updateChar(this, x, y); + } + } +} Frame.prototype.clearline = function(attr) { if(attr == undefined) attr = this.attr; @@ -1135,7 +1159,7 @@ Frame.prototype.putmsg = function(str,attr) { this.__putChar__.call(this,ch,this.__properties__.curr_attr); pos.x++; break; - } + } } } }