From b98e57feacd1a993cccc6e7da7bdf513b90ad48f Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Wed, 30 Sep 2009 09:14:31 -0400 Subject: [PATCH] overshoot clean ups: make it more generic --- kineticview.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kineticview.cpp b/kineticview.cpp index c0474dc..b50c39b 100644 --- a/kineticview.cpp +++ b/kineticview.cpp @@ -194,14 +194,15 @@ void KineticView::overshoot() { /* Detect if bouncer */ if( d->bounceStatus != KineticScrollingPrivate::Running ) { - if (d->cposition > 0) { + if( ( d->cposition > 0 ) || ( d->cposition < d->minimalPos + d->overshoot ) ) { + int finalPosition; scrollAnimation->setEasingCurve( QEasingCurve::OutBounce ); - resetAnimation( 0, 900 ); - d->bounceStatus = KineticScrollingPrivate::Running; - } else if (d->cposition < d->minimalPos + d->overshoot) { - const int finalPosition = -d->widget->size().height( ) + d->scrollingWidget->size().height(); - scrollAnimation->setEasingCurve( QEasingCurve::OutBounce ); + if (d->cposition > 0) + finalPosition = 0; + else + finalPosition = -d->widget->size().height( ) + d->scrollingWidget->size().height(); + resetAnimation( finalPosition, 900 ); d->bounceStatus = KineticScrollingPrivate::Running; } -- 2.11.4.GIT