From b051fa1e89af02bad2e4550fd3d9f969f0b54e56 Mon Sep 17 00:00:00 2001 From: Aferdita Muriqi Date: Sat, 25 Mar 2023 19:40:28 -0400 Subject: [PATCH 1/4] fixes odd page display in paginated mode --- src/views/ReflowableBookView.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/ReflowableBookView.ts b/src/views/ReflowableBookView.ts index d9581f40..7a2a5eb3 100644 --- a/src/views/ReflowableBookView.ts +++ b/src/views/ReflowableBookView.ts @@ -323,7 +323,10 @@ export default class ReflowableBookView implements BookView { } else { // TODO: need to double check this, why sometimes we get "rightWidth 0.091064453125" const rightWidth = Math.floor(this.getRightColumnsWidth()); - return rightWidth <= 0; + return ( + rightWidth <= 0 || + Math.ceil(this.getCurrentPage()) === this.getPageCount() + ); } } @@ -577,7 +580,7 @@ export default class ReflowableBookView implements BookView { get scrollWidth() { const scrollWidth = this.scrollingElement?.scrollWidth; const width = this.getColumnWidth(); - const pages = Math.floor(scrollWidth / width); + const pages = Math.ceil(scrollWidth / width); return pages * width; } } From 4daf3c629fb9d6e97abca7bf733051e5c7782141 Mon Sep 17 00:00:00 2001 From: Aferdita Muriqi Date: Sat, 25 Mar 2023 19:41:07 -0400 Subject: [PATCH 2/4] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17d71356..71f572de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@d-i-t-a/reader", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@d-i-t-a/reader", - "version": "2.3.1", + "version": "2.3.2", "license": "Apache-2.0", "dependencies": { "@types/pdfjs-dist": "^2.7.4", diff --git a/package.json b/package.json index 824bec60..8f22de68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@d-i-t-a/reader", - "version": "2.3.1", + "version": "2.3.2", "description": "A viewer application for EPUB files.", "repository": "https://github.com/d-i-t-a/R2D2BC", "license": "Apache-2.0", From 72dfb8d6e98e62ff7e6415eab69ec3d7981bf670 Mon Sep 17 00:00:00 2001 From: Aferdita Muriqi Date: Sat, 25 Mar 2023 19:42:22 -0400 Subject: [PATCH 3/4] revert registry --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f22de68..f40ceade 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "node": ">8.0.0" }, "publishConfig": { - "registry": "https://registry.npmjs.org/" + "registry": "https://npm.pkg.github.com/" }, "scripts": { "prepare": "npm run build", From decaee007dc8bde3872d61b969f3fe780094253c Mon Sep 17 00:00:00 2001 From: Aferdita Muriqi Date: Sat, 25 Mar 2023 19:43:27 -0400 Subject: [PATCH 4/4] revert registry --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f40ceade..8f22de68 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "node": ">8.0.0" }, "publishConfig": { - "registry": "https://npm.pkg.github.com/" + "registry": "https://registry.npmjs.org/" }, "scripts": { "prepare": "npm run build",