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

Add offset to start calculation

This commit is contained in:
Fred Chasen 2020-05-14 19:40:27 -07:00
parent 5c04784ab8
commit 992a3f7461

View file

@ -645,19 +645,11 @@ class DefaultViewManager {
let width = view.width();
// Find mapping
let start = left + container.left - position + used;
let start = left + container.left - position + offset + used;
let end = start + this.layout.width - used;
let mapping = this.mapping.page(view.contents, view.section.cfiBase, start, end);
// Find displayed pages
//console.log("pre", end, offset + width);
// if (end > offset + width) {
// end = offset + width;
// used = this.layout.pageWidth;
// }
// console.log("post", end);
let totalPages = this.layout.count(width).pages;
let startPage = Math.floor(start / this.layout.pageWidth);
let pages = [];