From 1eb1a3225433b43fe17593a508a62d22b7444f95 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Mar 2014 17:38:34 +0530 Subject: [PATCH] Cover Browser: Fix visual "pop" when scrolling the first time --- src/calibre/gui2/pictureflow/pictureflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/pictureflow/pictureflow.cpp b/src/calibre/gui2/pictureflow/pictureflow.cpp index d9811f02e7..1068dd56dd 100644 --- a/src/calibre/gui2/pictureflow/pictureflow.cpp +++ b/src/calibre/gui2/pictureflow/pictureflow.cpp @@ -496,9 +496,9 @@ void PictureFlowPrivate::setCurrentSlide(int index) { animateTimer.stop(); step = 0; - centerIndex = qBound(index, 0, slideImages->count()-1); + centerIndex = qBound(0, index, qMax(0, slideImages->count()-1)); target = centerIndex; - slideFrame = ((long long)index) << 16; + slideFrame = ((long long)centerIndex) << 16; resetSlides(); triggerRender(); widget->emitcurrentChanged(centerIndex);