Cover Browser: Fix visual "pop" when scrolling the first time

This commit is contained in:
Kovid Goyal 2014-03-22 17:38:34 +05:30
parent eaae5b235e
commit 1eb1a32254

View File

@ -496,9 +496,9 @@ void PictureFlowPrivate::setCurrentSlide(int index)
{ {
animateTimer.stop(); animateTimer.stop();
step = 0; step = 0;
centerIndex = qBound(index, 0, slideImages->count()-1); centerIndex = qBound(0, index, qMax(0, slideImages->count()-1));
target = centerIndex; target = centerIndex;
slideFrame = ((long long)index) << 16; slideFrame = ((long long)centerIndex) << 16;
resetSlides(); resetSlides();
triggerRender(); triggerRender();
widget->emitcurrentChanged(centerIndex); widget->emitcurrentChanged(centerIndex);