Discard cut off combined data when resizing BufferLines

This commit is contained in:
Daniel Imms
2018-12-31 10:26:10 -08:00
parent db488ebcc9
commit 40e8618cf5
2 changed files with 22 additions and 0 deletions
+9
View File
@@ -250,8 +250,17 @@ export class BufferLine implements IBufferLine {
const data = new Uint32Array(cols * CELL_SIZE);
data.set(this._data.subarray(0, cols * CELL_SIZE));
this._data = data;
// Remove any cut off combined data
const keys = Object.keys(this._combined);
for (let i = 0; i < keys.length; i++) {
const key = parseInt(keys[i], 10);
if (key >= cols) {
delete this._combined[key];
}
}
} else {
this._data = null;
this._combined = {};
}
}
this.length = cols;