From 352f9a852528f325971eb1e251a503379281f41e Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 8 Feb 2022 15:19:23 +0800 Subject: [PATCH] fix(webreader): don't pad landscape covers in double page mode --- komga-webui/src/functions/book-spreads.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/komga-webui/src/functions/book-spreads.ts b/komga-webui/src/functions/book-spreads.ts index 98a92afb0..54a864588 100644 --- a/komga-webui/src/functions/book-spreads.ts +++ b/komga-webui/src/functions/book-spreads.ts @@ -12,10 +12,16 @@ export function buildSpreads(pages: PageDtoWithUrl[], pageLayout: PagedReaderLay let lastPages = undefined if (pageLayout === PagedReaderLayout.DOUBLE_PAGES) { const firstPage = pagesClone.shift() as PageDtoWithUrl - spreads.push([createEmptyPage(firstPage), firstPage] as PageDtoWithUrl[]) + if (isPageLandscape(firstPage)) + spreads.push([firstPage] as PageDtoWithUrl[]) + else + spreads.push([createEmptyPage(firstPage), firstPage] as PageDtoWithUrl[]) if (pagesClone.length > 0) { const lastPage = pagesClone.pop() as PageDtoWithUrl - lastPages = [lastPage, createEmptyPage(lastPage)] as PageDtoWithUrl[] + if(isPageLandscape(lastPage)) + lastPages = [lastPage] as PageDtoWithUrl[] + else + lastPages = [lastPage, createEmptyPage(lastPage)] as PageDtoWithUrl[] } } while (pagesClone.length > 0) {