From eb40f6e6e9bd5793a102873f66e1ff30c627d9b3 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 8 Jan 2023 14:07:48 -0600 Subject: [PATCH] Fix:Library list view cover size #474 --- components/cards/LazyBookCard.vue | 6 ++--- components/cards/LazyListBookCard.vue | 36 ++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index 5d4090ca..ffd9302f 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -526,9 +526,9 @@ export default { this.imageReady = true if (this.$refs.cover && this.bookCoverSrc !== this.placeholderUrl) { - var { naturalWidth, naturalHeight } = this.$refs.cover - var aspectRatio = naturalHeight / naturalWidth - var arDiff = Math.abs(aspectRatio - this.bookCoverAspectRatio) + const { naturalWidth, naturalHeight } = this.$refs.cover + const aspectRatio = naturalHeight / naturalWidth + const arDiff = Math.abs(aspectRatio - this.bookCoverAspectRatio) // If image aspect ratio is <= 1.45 or >= 1.75 then use cover bg, otherwise stretch to fit if (arDiff > 0.15) { diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index 192930df..851c89fe 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -1,18 +1,18 @@