diff --git a/melpomene.js b/melpomene.js index 1ca0744..a3a8e3c 100644 --- a/melpomene.js +++ b/melpomene.js @@ -180,11 +180,11 @@ function getPagesCount() { } function pageOriginalHeight(pageNumber) { - return READER_PAGES.children[pageNumber - 1].height + return READER_PAGES.children[pageNumber - 1].naturalHeight } function pageOriginalWidth(pageNumber) { - return READER_PAGES.children[pageNumber - 1].width + return READER_PAGES.children[pageNumber - 1].naturalWidth } function readerFrameRatio() { @@ -192,15 +192,15 @@ function readerFrameRatio() { } function pageRatio(pageNumber) { - return READER_PAGES.children[pageNumber - 1].width / READER_PAGES.children[pageNumber - 1].height + return READER_PAGES.children[pageNumber - 1].naturalWidth / READER_PAGES.children[pageNumber - 1].naturalHeight } function pageMaxHeight(){ let max_height = 0 for (var i = 0; i < READER_PAGES.children.length; i++) { - if(READER_PAGES.children[i].height > max_height){ - max_height = READER_PAGES.children[i].height + if(READER_PAGES.children[i].naturalHeight > max_height){ + max_height = READER_PAGES.children[i].naturalHeight } } @@ -217,7 +217,7 @@ function previousPagesWidth(pageNumber) { let totalWidth = 0 for (let idx = 0; idx < pageNumber - 1; idx++){ - totalWidth = totalWidth + READER_PAGES.children[idx].width + totalWidth = totalWidth + READER_PAGES.children[idx].naturalWidth } return totalWidth