Skip to content

Commit

Permalink
Merge pull request #1233 from cdrini/fix/move-healing
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrini authored Sep 5, 2023
2 parents c8c8b9e + 2df8cf6 commit d7163f5
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/BookReader/BookModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ export class BookModel {
this._medianPageSize = null;
/** @type {[PageData[], number]} */
this._getDataFlattenedCached = null;

// Heal missing first page number assertion
const pages = this._getDataFlattened();
const firstNumberedPageIndex = pages.findIndex(page => page.pageNum != undefined && !isNaN(parseFloat(page.pageNum)));
if (firstNumberedPageIndex != -1 && firstNumberedPageIndex > 0) {
const pageNum = parseFloat(pages[firstNumberedPageIndex].pageNum);
if (!isNaN(pageNum)) {
// Note: Since the pages are always sorted in increasing pageNum/index
// order, this will work for both left-to-right and right-to-left books
pages[firstNumberedPageIndex - 1].pageNum = pageNum - 1;
}
}
}

/** Get median width/height of page in inches. Memoized for performance. */
Expand Down

0 comments on commit d7163f5

Please sign in to comment.