fix update lines
This commit is contained in:
parent
250d4d9255
commit
fa2dd94e5c
1 changed files with 12 additions and 4 deletions
|
|
@ -116,7 +116,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
/**
|
/**
|
||||||
* Triggers partial update of the text layer
|
* Triggers partial update of the text layer
|
||||||
*/
|
*/
|
||||||
this.updateLines = function(firstRow, lastRow) {
|
this.updateLines = function(firstRow, lastRow) {
|
||||||
if (!this.$changedLines) {
|
if (!this.$changedLines) {
|
||||||
this.$changedLines = {
|
this.$changedLines = {
|
||||||
firstRow: firstRow,
|
firstRow: firstRow,
|
||||||
|
|
@ -130,6 +130,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
if (this.$changedLines.lastRow < lastRow)
|
if (this.$changedLines.lastRow < lastRow)
|
||||||
this.$changedLines.lastRow = lastRow;
|
this.$changedLines.lastRow = lastRow;
|
||||||
}
|
}
|
||||||
|
if (this.$changedLines.lastRow === undefined)
|
||||||
|
this.$changedLines.lastRow = Infinity;
|
||||||
|
|
||||||
this.$loop.schedule(this.CHANGE_LINES);
|
this.$loop.schedule(this.CHANGE_LINES);
|
||||||
};
|
};
|
||||||
|
|
@ -371,7 +373,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$updateLines = function() {
|
this.$updateLines = function() {
|
||||||
var firstRow = this.$changedLines.firstRow;
|
var firstRow = this.$changedLines.firstRow;
|
||||||
var lastRow = this.$changedLines.lastRow;
|
var lastRow = this.$changedLines.lastRow;
|
||||||
this.$changedLines = null;
|
this.$changedLines = {
|
||||||
|
firstRow: 0,
|
||||||
|
lastRow: Infinity
|
||||||
|
};
|
||||||
|
|
||||||
var layerConfig = this.layerConfig;
|
var layerConfig = this.layerConfig;
|
||||||
|
|
||||||
|
|
@ -383,8 +388,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
if (lastRow < layerConfig.firstRow) { return; }
|
if (lastRow < layerConfig.firstRow) { return; }
|
||||||
|
|
||||||
// if the last row is unknown -> redraw everything
|
// if the last row is unknown -> redraw everything
|
||||||
if (lastRow === undefined)
|
if (lastRow === Infinity) {
|
||||||
return this.$textLayer.update(layerConfig);
|
this.$gutterLayer.update(layerConfig);
|
||||||
|
this.$textLayer.update(layerConfig);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// else update only the changed rows
|
// else update only the changed rows
|
||||||
this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
|
this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue