mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
make the return value of the calcImageIndex function more robust
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user