update files

This commit is contained in:
nuintun 2015-12-03 17:17:48 +08:00
parent efbd0100b9
commit 10b9f8f8d9

View File

@ -23,6 +23,7 @@ function CanvasXTerm(font){
CanvasXTerm.prototype = {
draw: function (screen){
var text = '';
var width, height;
var rows = screen.length;
var cols = rows ? screen[0].length : 0;
var node, i, j, x, y, attrCache, stylesCache;
@ -31,14 +32,21 @@ CanvasXTerm.prototype = {
this.rows = rows;
this.cols = cols;
this.canvas.width = this.measureWidth(
width = this.measureWidth(
textRepeat('A', cols),
'italic bold ' + this.font.size + 'px ' + this.font.family
);
this.canvas.height = rows * this.font.lineHeight;
height = rows * this.font.lineHeight;
} else {
width = this.canvas.width;
height = this.canvas.height;
}
// clear canvas
this.canvas.width = width;
this.canvas.height = height;
for (i = 0; i < rows; i++) {
x = 0;
y = i * this.font.lineHeight + this.baseY;