Skip to content

Commit

Permalink
Merge pull request #1075 from futurepress/text_height_fix
Browse files Browse the repository at this point in the history
Use bottom of rect to get height in textHeight
  • Loading branch information
fchasen committed Jun 3, 2020
2 parents 0adbb08 + 589f27e commit 50fcbb2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,11 @@ class Contents {
let height;
let range = this.document.createRange();
let content = this.content || this.document.body;
let border = borders(content);

range.selectNodeContents(content);

rect = range.getBoundingClientRect();
height = rect.height;

if (height && border.height) {
height += border.height;
}
height = rect.bottom;

return Math.round(height);
}
Expand Down

0 comments on commit 50fcbb2

Please sign in to comment.