From 6a15dae8c2f09c99bb124b4587ff8088b35a7273 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 12 Sep 2011 12:40:20 +1000 Subject: [PATCH] Port change 67ed1849 from Qt 4.7 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. Task-number: QT-4903 Change-Id: Ie4c2a3829026c0bf7d94cf5b60c0b7ff9833f725 Reviewed-on: http://codereview.qt-project.org/4618 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- src/declarative/items/qsgflickable.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/declarative/items/qsgflickable.cpp b/src/declarative/items/qsgflickable.cpp index 962eb96..359d150 100644 --- a/src/declarative/items/qsgflickable.cpp +++ b/src/declarative/items/qsgflickable.cpp @@ -235,8 +235,8 @@ void QSGFlickablePrivate::AxisData::addVelocitySample(qreal v, qreal maxVelocity void QSGFlickablePrivate::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); -- 1.7.2.5