mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 11:34:05 +08:00
update files
This commit is contained in:
parent
a6438766d1
commit
b18bcec73d
@ -78,6 +78,7 @@ CanvasXTerm.prototype = {
|
|||||||
var context = this;
|
var context = this;
|
||||||
var rows = screen.rows;
|
var rows = screen.rows;
|
||||||
var cols = screen.cols;
|
var cols = screen.cols;
|
||||||
|
var lineCache = null;
|
||||||
var attrCache = null;
|
var attrCache = null;
|
||||||
var stylesCache = null;
|
var stylesCache = null;
|
||||||
var width, height;
|
var width, height;
|
||||||
@ -120,10 +121,10 @@ CanvasXTerm.prototype = {
|
|||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
y = i * this.font.lineHeight;
|
y = i * this.font.lineHeight;
|
||||||
line = this.lru.get(line.id);
|
lineCache = this.lru.get(line.id);
|
||||||
|
|
||||||
if (line && line.version === screen.buffer[i].version) {
|
if (lineCache && lineCache.version === line.version) {
|
||||||
this.brush.drawImage(line.canvas, 0, y, line.canvas.width, line.canvas.height);
|
this.brush.drawImage(lineCache.canvas, 0, y, lineCache.canvas.width, lineCache.canvas.height);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +135,7 @@ CanvasXTerm.prototype = {
|
|||||||
brush = canvas.getContext('2d');
|
brush = canvas.getContext('2d');
|
||||||
|
|
||||||
for (j = 0; j < cols; j++) {
|
for (j = 0; j < cols; j++) {
|
||||||
node = screen.buffer[i].cells[j];
|
node = line.cells[j];
|
||||||
|
|
||||||
if (!node) {
|
if (!node) {
|
||||||
continue;
|
continue;
|
||||||
@ -160,9 +161,11 @@ CanvasXTerm.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.brush.drawImage(canvas, 0, y, canvas.width, canvas.height);
|
this.brush.drawImage(canvas, 0, y, canvas.width, canvas.height);
|
||||||
this.lru.set(screen.buffer[i].id, {
|
|
||||||
|
// cache line
|
||||||
|
this.lru.set(line.id, {
|
||||||
canvas: canvas,
|
canvas: canvas,
|
||||||
version: screen.buffer[i].version
|
version: line.version
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user