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

Updated scrolled display to work on vertical and horizontal axis

This commit is contained in:
Fred Chasen 2020-06-03 13:50:34 -07:00
parent e9b074fde3
commit 4a2e9e97a9
6 changed files with 90 additions and 38 deletions

View file

@ -189,15 +189,17 @@ class Layout {
* @param {Contents} contents
* @return {Promise}
*/
format(contents, section){
format(contents, section, axis){
var formating;
if (this.name === "pre-paginated") {
formating = contents.fit(this.columnWidth, this.height, section);
} else if (this._flow === "paginated") {
formating = contents.columns(this.width, this.height, this.columnWidth, this.gap, this.settings.direction);
} else { // scrolled
formating = contents.size(this.width, null);
} else if (axis && axis === "horizontal") {
formating = contents.size(null, this.height);
} else {
formating = contents.size(this.width, null);
}
return formating; // might be a promise in some View Managers