From 72760e63889f7d0cd6a73e99755753a152e21f7e Mon Sep 17 00:00:00 2001 From: Spedon Date: Tue, 14 Mar 2023 11:16:11 +0800 Subject: [PATCH] make the return value of the calcImageIndex function more robust --- assets/ts/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/ts/utils.ts b/assets/ts/utils.ts index 422f4a9..58008a7 100644 --- a/assets/ts/utils.ts +++ b/assets/ts/utils.ts @@ -93,6 +93,6 @@ export function calcImageIndex(index: number, imgCounts: number): number { if (index >= 0) { return index % imgCounts } else { - return imgCounts + (index % imgCounts) + return (imgCounts + (index % imgCounts)) % imgCounts } }