From 53f56725248f5c1322d1452ad443cf8c6b8a9523 Mon Sep 17 00:00:00 2001 From: paris Date: Fri, 29 Aug 2014 09:57:53 +0000 Subject: [PATCH] Fix #3 --- addons/fit/fit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/fit/fit.js b/addons/fit/fit.js index 7bc73cd2..3dc339af 100644 --- a/addons/fit/fit.js +++ b/addons/fit/fit.js @@ -17,7 +17,6 @@ Terminal.prototype.fit = function () { rows, contentBuffer, characterWidth, - characterHeight, cols; subjectRow.style.display = 'inline'; @@ -37,9 +36,10 @@ Terminal.prototype.fit = function () { parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height')), elementStyle = window.getComputedStyle(this.element), elementPadding = parseInt(elementStyle.getPropertyValue('padding-top')) + parseInt(elementStyle.getPropertyValue('padding-bottom')), - availableHeight = parentElementHeight - elementPadding; + availableHeight = parentElementHeight - elementPadding, + rowHeight = this.rowContainer.firstElementChild.offsetHeight; - rows = parseInt(availableHeight / characterHeight); + rows = parseInt(availableHeight / rowHeight); this.resize(cols, rows); }; \ No newline at end of file