update files

This commit is contained in:
nuintun 2015-12-04 16:25:19 +08:00
parent d22eb5c1a0
commit 130100e053

View File

@ -46,7 +46,7 @@ CanvasXTerm.prototype = {
var attrCache = null; var attrCache = null;
var stylesCache = null; var stylesCache = null;
var width, height; var width, height;
var node, i, j, x, y; var node, i, j, x, y, line, canvas, brush;
if (!this.rows || !this.cols || this.rows !== rows || this.cols !== cols) { if (!this.rows || !this.cols || this.rows !== rows || this.cols !== cols) {
this.rows = rows; this.rows = rows;
@ -70,10 +70,6 @@ CanvasXTerm.prototype = {
this.canvas.width = width; this.canvas.width = width;
this.canvas.height = height; this.canvas.height = height;
var line;
var canvas;
var brush;
function reset(){ function reset(){
text = ''; text = '';
attrCache = node.attr; attrCache = node.attr;
@ -81,9 +77,15 @@ CanvasXTerm.prototype = {
} }
for (i = 0; i < rows; i++) { for (i = 0; i < rows; i++) {
line = screen.buffer[i];
if (!line) {
continue;
}
x = 0; x = 0;
y = i * this.font.lineHeight; y = i * this.font.lineHeight;
line = this.lru.get(screen.buffer[i].id); line = this.lru.get(line.id);
if (line && line.version === screen.buffer[i].version) { if (line && line.version === screen.buffer[i].version) {
this.brush.drawImage(line.canvas, 0, y, line.canvas.width, line.canvas.height); this.brush.drawImage(line.canvas, 0, y, line.canvas.width, line.canvas.height);
@ -99,6 +101,10 @@ CanvasXTerm.prototype = {
for (j = 0; j < cols; j++) { for (j = 0; j < cols; j++) {
node = screen.buffer[i].cells[j]; node = screen.buffer[i].cells[j];
if (!node) {
continue;
}
if (j === 0) { if (j === 0) {
reset(); reset();
} }