Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 73aa01f

Browse files
authored
Merge pull request #1100 from vqum/master
Parsons height display bug fix (Vincent Qiu November 2020)
2 parents c77f2ad + 5092945 commit 73aa01f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

runestone/parsons/js/parsons.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ export default class Parsons extends RunestoneBase {
14661466
// Increment Parsons area height based on number of lines of text in the current Parsons block - Vincent Qiu (September 2020)
14671467
var singleHeight = 40;
14681468
var additionalHeight = 20;
1469-
areaHeight += Math.ceil(
1469+
areaHeight += Math.ceil( // For future more accurate height display, this calculation should also be conditionally based on fontFamily
14701470
singleHeight +
14711471
(linesItem[linesIndex].children.length - 1) *
14721472
additionalHeight +
@@ -1492,7 +1492,7 @@ export default class Parsons extends RunestoneBase {
14921492
linesItem[linesIndex].children[i].innerText
14931493
).width
14941494
);
1495-
longCount += Math.floor(itemLength / widthLimit);
1495+
longCount += Math.floor(itemLength / (widthLimit - 29));
14961496
if (itemLength > maxInnerLength) {
14971497
maxInnerText =
14981498
linesItem[linesIndex].children[i].innerText;

0 commit comments

Comments
 (0)