mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
Use bottom of rect to get height in textHeight
This commit is contained in:
parent
0adbb08dac
commit
589f27eb63
1 changed files with 1 additions and 6 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue