diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-12-02 15:26:50 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2015-12-07 16:42:26 +0000 |
commit | 8f339861d48a6d624516780442e191b55209a053 (patch) | |
tree | 7c0f00f3c66f3a9e834a8f717690567f06a45e96 /src | |
parent | d2305265af0552f9fcab4c93bed6b93e25a28f78 (diff) |
Flickable: avoid perturbing the timeline further while in overshoot
The bug was that when using the mouse wheel, a single "scroll down"
wheel event followed by a rapid succession of "scroll up" events
would cause extreme overshoot. Experimentally determined that when
this happens, the calls to timeline.accel() in
QQuickFlickablePrivate::flick() were occurring after the call to
accel in QQuickFlickablePrivate::viewportAxisMoved(). But nearby,
data.inOvershoot is set to true, so that can be used to avoid calling
accel() additional times in flick(). So basically, this patch avoids
doing any more acceleration in response to further wheel events after
the momentum from previous events has already taken the content
beyond bounds.
Task-number: QTBUG-21328
Change-Id: I3ab5510a288a080f6b526407b6a2293c44a2498a
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 9d6c51f37a..092d4afdd9 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -344,10 +344,12 @@ bool QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExt accel = v2 / (2.0f * qAbs(dist)); resetTimeline(data); - if (boundsBehavior & QQuickFlickable::OvershootBounds) - timeline.accel(data.move, v, accel); - else - timeline.accel(data.move, v, accel, maxDistance); + if (!data.inOvershoot) { + if (boundsBehavior & QQuickFlickable::OvershootBounds) + timeline.accel(data.move, v, accel); + else + timeline.accel(data.move, v, accel, maxDistance); + } timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); if (&data == &hData) |