diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-05-25 03:01:33 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-05-25 03:01:33 (GMT) |
commit | 67ed18497705fa938728c505d165173dc5d3de68 (patch) | |
tree | 1a1ed087661e916b5a92262bc9f3ed3f84d9729c | |
parent | a0b2fc44ff8752193cacde52276b1822741f5374 (diff) | |
download | Qt-67ed18497705fa938728c505d165173dc5d3de68.zip Qt-67ed18497705fa938728c505d165173dc5d3de68.tar.gz Qt-67ed18497705fa938728c505d165173dc5d3de68.tar.bz2 |
Flickable could flick in wrong direction if given too few touch samples
If we got <= QML_FLICK_DISCARDSAMPLES the previous velocity was not
cleared, so the view would continue flicking with the previous
velocity, and therefore the previous direction.
Change-Id: I876610f4522f32c814449309b01ec3787c5f6cc6
Task-number: QT-4903
Reviewed-by: Andrew den Exter
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflickable.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 82ed18c..2bf863b 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -232,8 +232,8 @@ void QDeclarativeFlickablePrivate::AxisData::addVelocitySample(qreal v, qreal ma void QDeclarativeFlickablePrivate::AxisData::updateVelocity() { + velocity = 0; if (velocityBuffer.count() > QML_FLICK_DISCARDSAMPLES) { - velocity = 0; int count = velocityBuffer.count()-QML_FLICK_DISCARDSAMPLES; for (int i = 0; i < count; ++i) { qreal v = velocityBuffer.at(i); |