1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Add min spread width in determineLayoutProperties

This commit is contained in:
Fred Chasen 2016-09-06 14:36:54 +02:00
parent 4e7276c151
commit eed4a45cb6
7 changed files with 74 additions and 2032 deletions

View file

@ -5,7 +5,7 @@ function Layout(settings){
this.name = settings.layout || "reflowable";
this._flow = (settings.flow === "paginated") ? "paginated" : "scrolled";
this._spread = (settings.spread === "none") ? false : true;
this.minSpreadWidth = 800;
this._minSpreadWidth = settings.spread || 800;
this.width = 0;
this.height = 0;
@ -28,7 +28,7 @@ Layout.prototype.spread = function(spread, min) {
this._spread = (spread === "none") ? false : true;
if (min >= 0) {
this.minSpreadWidth = min;
this._minSpreadWidth = min;
}
}
@ -47,7 +47,7 @@ Layout.prototype.calculate = function(_width, _height, _gap){
var spreadWidth;
var delta;
if (this._spread && width >= this.minSpreadWidth) {
if (this._spread && width >= this._minSpreadWidth) {
divisor = 2;
} else {
divisor = 1;