#69 : Fix case, update tests
This commit is contained in:
@@ -6,12 +6,10 @@ export function getNextParticleIndexLimited({
|
||||
currentParticleIndex,
|
||||
particlesCount,
|
||||
particlesToScroll,
|
||||
particlesToShow,
|
||||
}) {
|
||||
if (particlesCount < 1) throw new Error('particlesCount must be at least 1')
|
||||
return Math.max(
|
||||
currentParticleIndex + Math.min(particlesCount - (currentParticleIndex + 1) - particlesToScroll, particlesToScroll),
|
||||
0
|
||||
)
|
||||
return getValueInRange(0, currentParticleIndex + particlesToScroll, particlesCount - particlesToShow)
|
||||
}
|
||||
|
||||
export function getNextParticleIndexInfinte({
|
||||
|
||||
Reference in New Issue
Block a user