refresh the height of the viewport when the line-height changed

This commit is contained in:
ayapi
2016-08-18 19:37:16 +09:00
parent 43fc6f1fa3
commit dcc991bd5c
2 changed files with 16 additions and 2 deletions
+4 -2
View File
@@ -357,12 +357,14 @@
Viewport.prototype.refresh = function(charSize) {
var size = charSize || this.charMeasureElement.getBoundingClientRect();
if (size.height > 0) {
if (size.height !== this.currentRowHeight) {
var rowHeightChanged = size.height !== this.currentRowHeight;
if (rowHeightChanged) {
this.currentRowHeight = size.height;
this.viewportElement.style.lineHeight = size.height + 'px';
this.terminal.rowContainer.style.lineHeight = size.height + 'px';
}
if (this.lastRecordedViewportHeight !== this.terminal.rows) {
var viewportHeightChanged = this.lastRecordedViewportHeight !== this.terminal.rows;
if (rowHeightChanged || viewportHeightChanged) {
this.lastRecordedViewportHeight = this.terminal.rows;
this.viewportElement.style.height = size.height * this.terminal.rows + 'px';
}