Merge pull request #598 from mikesir87/fix-fit-calculation

Fixed characterHeight calculation, which could cause overflowing
This commit is contained in:
Paris Kasidiaris
2017-03-15 14:34:13 +00:00
committed by GitHub
+1 -1
View File
@@ -56,7 +56,7 @@
subjectRow.innerHTML = 'W'; // Common character for measuring width, although on monospace
characterWidth = subjectRow.getBoundingClientRect().width;
subjectRow.style.display = ''; // Revert style before calculating height, since they differ.
characterHeight = parseInt(subjectRow.offsetHeight);
characterHeight = subjectRow.getBoundingClientRect().height;
subjectRow.innerHTML = contentBuffer;
rows = parseInt(availableHeight / characterHeight);