check for 0 division, stops parallax failing if only the single horizontal slide and multiple vertical

This commit is contained in:
Mike Mellor 2015-11-13 15:13:30 +00:00
parent 822a9c937c
commit 3e42929f90

View File

@ -2798,7 +2798,7 @@
horizontalOffsetMultiplier = config.parallaxBackgroundHorizontal;
}
else {
horizontalOffsetMultiplier = ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 );
horizontalOffsetMultiplier = ( horizontalSlideCount-1 > 0) ? ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) : 0;
}
horizontalOffset = horizontalOffsetMultiplier * indexh * -1;