mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Merge pull request #927 from mikkelvp/dev
Respect pre-paginated page spreads
This commit is contained in:
commit
7b8480fde0
8 changed files with 214 additions and 36 deletions
|
@ -1094,7 +1094,7 @@ class Contents {
|
|||
* @param {number} width
|
||||
* @param {number} height
|
||||
*/
|
||||
fit(width, height){
|
||||
fit(width, height, section){
|
||||
var viewport = this.viewport();
|
||||
var viewportWidth = parseInt(viewport.width);
|
||||
var viewportHeight = parseInt(viewport.height);
|
||||
|
@ -1124,6 +1124,11 @@ class Contents {
|
|||
this.css("background-size", viewportWidth * scale + "px " + viewportHeight * scale + "px");
|
||||
|
||||
this.css("background-color", "transparent");
|
||||
if (section && section.properties.includes("page-spread-left")) {
|
||||
// set margin since scale is weird
|
||||
var marginLeft = width - (viewportWidth * scale);
|
||||
this.css("margin-left", marginLeft + "px");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue