From 7b8f6d6ce5bf59e4a9a18b44b0adfa0f463ca720 Mon Sep 17 00:00:00 2001 From: Julie Jiang Date: Wed, 29 May 2024 14:48:01 +1000 Subject: [PATCH] fix: round down card width if it's not a whole number --- src/plugins/web/web.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/web/web.ts b/src/plugins/web/web.ts index 00a2293..c6e7ae8 100644 --- a/src/plugins/web/web.ts +++ b/src/plugins/web/web.ts @@ -166,8 +166,8 @@ export default function Web( for (let i = 0; i < slidesCount; i++) { const size = perView === 'auto' - ? getElementSize(elems[i]) - : 1 / (perView as number) - spacing + spacingPortion + ? Math.floor(getElementSize(elems[i])) + : 1 / Math.floor((perView as number)) - spacing + spacingPortion const origin = originOption === 'center' ? 0.5 - size / 2