1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

Use bottom of rect to get height in textHeight

This commit is contained in:
Fred Chasen 2020-06-03 13:56:02 -07:00
parent 0adbb08dac
commit 589f27eb63

View file

@ -173,16 +173,11 @@ class Contents {
let height; let height;
let range = this.document.createRange(); let range = this.document.createRange();
let content = this.content || this.document.body; let content = this.content || this.document.body;
let border = borders(content);
range.selectNodeContents(content); range.selectNodeContents(content);
rect = range.getBoundingClientRect(); rect = range.getBoundingClientRect();
height = rect.height; height = rect.bottom;
if (height && border.height) {
height += border.height;
}
return Math.round(height); return Math.round(height);
} }