summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Engels <ralf.engels@nokia.com>2010-03-30 14:06:44 +0200
committerRalf Engels <ralf.engels@nokia.com>2010-03-30 14:06:44 +0200
commit0d6ca766976f0da8e333e3928ee94f585c79b8b6 (patch)
tree625ea474c5b87394b0c2cd9c82af6024ed1fb306
parentd71d6f2c96c0b591241e18b480b1a12290e6c3e6 (diff)
Cosmetic changes
-rw-r--r--qkineticscroller.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/qkineticscroller.cpp b/qkineticscroller.cpp
index f60f51e..bd1a58c 100644
--- a/qkineticscroller.cpp
+++ b/qkineticscroller.cpp
@@ -319,7 +319,7 @@ void QKineticScrollerPrivate::handleDrag(const QPointF &position, qint64 timesta
}
// calculate velocity (if the user would release the mouse NOW)
- QPointF newVelocity = calculateVelocity(deltaPixel, deltaTime);
+ updateVelocity(deltaPixel, deltaTime);
// restrict velocity, if content is not scrollable
QPointF maxPos = q->maximumContentPosition();
@@ -328,13 +328,12 @@ void QKineticScrollerPrivate::handleDrag(const QPointF &position, qint64 timesta
if (!canScrollX) {
deltaPixel.setX(0);
- newVelocity.setX(0);
+ velocity.setX(0);
}
if (!canScrollY) {
deltaPixel.setY(0);
- newVelocity.setY(0);
+ velocity.setY(0);
}
- velocity = newVelocity;
// if (firstDrag) {
// // Do not delay the first drag
@@ -428,7 +427,7 @@ bool QKineticScrollerPrivate::moveWhilePressed(QKineticScroller::Input, const QP
q->cancelPress(pressPosition);
setState(QKineticScroller::StateDragging);
- // ignore the dragStartDistance
+ // subtract the dragStartDistance
deltaPixel = deltaPixel - deltaPixel * (dragStartDistance / deltaPixel.manhattanLength());
if (!deltaPixel.isNull()) {
@@ -450,8 +449,10 @@ void QKineticScrollerPrivate::timerEventWhileDragging(qint64 timestamp)
{
Q_Q(QKineticScroller);
- if (!dragDistance.isNull())
+ if (!dragDistance.isNull()) {
setScrollPositionHelper(q->contentPosition() - overshootDistance - dragDistance);
+ dragDistance = QPointF(0, 0);
+ }
}
bool QKineticScrollerPrivate::releaseWhileDragging(QKineticScroller::Input, const QPointF &position, qint64 timestamp)