1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Fix width for spreads

This commit is contained in:
Fred Chasen 2018-09-26 21:45:32 -07:00
parent 9c98ca303a
commit 605211046d
2 changed files with 2 additions and 10 deletions

View file

@ -157,10 +157,6 @@ class Contents {
rect = range.getBoundingClientRect(); rect = range.getBoundingClientRect();
width = rect.width; width = rect.width;
if (this.content === this.document.body && rect.left) {
width += rect.left;
}
if (border && border.width) { if (border && border.width) {
width += border.width; width += border.width;
} }
@ -184,10 +180,6 @@ class Contents {
rect = range.getBoundingClientRect(); rect = range.getBoundingClientRect();
height = rect.height; height = rect.height;
if (this.content === this.document.body && rect.top) {
height += rect.top;
}
if (height && border.height) { if (height && border.height) {
height += border.height; height += border.height;
} }

View file

@ -277,12 +277,12 @@ class IframeView {
} }
if (this.settings.forceEvenPages) { if (this.settings.forceEvenPages) {
columns = (width / this.layout.delta); columns = (width / this.layout.pageWidth);
if ( this.layout.divisor > 1 && if ( this.layout.divisor > 1 &&
this.layout.name === "reflowable" && this.layout.name === "reflowable" &&
(columns % 2 > 0)) { (columns % 2 > 0)) {
// add a blank page // add a blank page
width += this.layout.gap + this.layout.columnWidth; width += this.layout.pageWidth;
} }
} }