mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-21 13:39:30 -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) {
|
if (index >= 0) {
|
||||||
return index % imgCounts
|
return index % imgCounts
|
||||||
} else {
|
} else {
|
||||||
return imgCounts + (index % imgCounts)
|
return (imgCounts + (index % imgCounts)) % imgCounts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user