From 6faeb2ab2e1aa8dafe6309566fbc5b7b663ec50f Mon Sep 17 00:00:00 2001 From: edwinbadillo Date: Wed, 12 Aug 2020 10:01:48 -0400 Subject: [PATCH] Adding Scaling and padding to the Webreader's webtoon mode (#266) * feat(webreader): adding scale type original to webtoon mode * fix(webreader): correcting scale type used for continuous reader * feat(webreader): adding setting for side padding to webtoon mode * feat(webreader): adding shortcut for side padding and new values * refactor: update padding percentage data type to number array * fix: correcting type issues after previous refactor * fix: images not showing if page has no dimension width and height on pages are not guaranteed * refactor: add new enum values to ScaleTypeText previous behavior worked only because the values of ScaleType and ContinuousScaleType are the same * refactor: simplify conditions fullWidthReader was only used for the continuous reader settings inside a reader type are not conditional * refactor: rearrange shortcuts continuous reader did not have specific settings this rearranges shortcuts for the help menu Co-authored-by: Gauthier Roebroeck --- .../components/readers/ContinuousReader.vue | 39 +++++- komga-webui/src/functions/reader.ts | 4 +- .../src/functions/shortcuts/bookreader.ts | 3 - .../functions/shortcuts/continuous-reader.ts | 7 ++ .../src/functions/shortcuts/paged-reader.ts | 6 + komga-webui/src/types/enum-reader.ts | 7 ++ komga-webui/src/views/BookReader.vue | 113 ++++++++++++++++-- 7 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 komga-webui/src/functions/shortcuts/continuous-reader.ts diff --git a/komga-webui/src/components/readers/ContinuousReader.vue b/komga-webui/src/components/readers/ContinuousReader.vue index c4c408d74..c636ad679 100644 --- a/komga-webui/src/components/readers/ContinuousReader.vue +++ b/komga-webui/src/components/readers/ContinuousReader.vue @@ -7,9 +7,10 @@ :key="`page${i}`" :alt="`Page ${page.number}`" :src="shouldLoad(i) ? page.url : undefined" - :height="page.height / (page.width / $vuetify.breakpoint.width)" - :width="$vuetify.breakpoint.width" + :height="calcHeight(page)" + :width="calcWidth(page)" :id="`page${page.number}`" + style="margin: 0 auto;" v-intersect="onIntersect" /> @@ -36,6 +37,7 @@