From 31a0996b2f6084621bb18dbd836dbadad91433ea Mon Sep 17 00:00:00 2001 From: yutaka Date: Wed, 8 Mar 2017 00:27:22 +0000 Subject: [PATCH] Revert "Set charMeasure.height values to each row height" This reverts commit 43cb4f471fb69ec1bd7d5f0bf99fe867c8056d56. --- src/xterm.js | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 8385b601..a08e9dd1 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -562,7 +562,6 @@ Terminal.bindKeys = function(term) { Terminal.prototype.insertRow = function (row) { if (typeof row != 'object') { row = document.createElement('div'); - row.style.height = this.charMeasure.height + 'px'; } this.rowContainer.appendChild(row); @@ -643,18 +642,17 @@ Terminal.prototype.open = function(parent) { this.charSizeStyleElement = document.createElement('style'); this.helperContainer.appendChild(this.charSizeStyleElement); - this.charMeasure = new CharMeasure(document, this.helperContainer); - this.charMeasure.on('charsizechanged', function () { - self.updateCharSizeCSS(); - self.updateRowHeight(); - }); - this.charMeasure.measure(); - for (; i < this.rows; i++) { this.insertRow(); } this.parent.appendChild(this.element); + this.charMeasure = new CharMeasure(document, this.helperContainer); + this.charMeasure.on('charsizechanged', function () { + self.updateCharSizeCSS(); + }); + this.charMeasure.measure(); + this.viewport = new Viewport(this, this.viewportElement, this.viewportScrollArea, this.charMeasure); this.renderer = new Renderer(this); @@ -716,15 +714,6 @@ Terminal.prototype.updateCharSizeCSS = function() { this.charSizeStyleElement.textContent = '.xterm-wide-char{width:' + (this.charMeasure.width * 2) + 'px;}'; } -/** - * Updates the height for each rows - */ -Terminal.prototype.updateRowHeight = function() { - for (var i = 0; i < this.children.length; ++i) { - this.children[i].style.height = this.charMeasure.height + 'px'; - } -} - /** * XTerm mouse events * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking