diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-29 10:48:54 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-29 10:48:54 +0100 |
commit | 4e33b069c426c975319d91e11223114fd0d8ad40 (patch) | |
tree | d73e1251bc313b7303fdb000c0789cdfb4c7bb1f /src/quick/items/qquickflickable.cpp | |
parent | d9e70d1a49af347f79db7e64bdd8e2e8083a77b5 (diff) | |
parent | 05d8ffb4dff5e693967c8ee7cee6d6158eadccbd (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/quick/items/qquickaccessibleattached_p.h
src/quick/items/qquickwindow.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index c3a56ba8d8..f851ef1bac 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -334,7 +334,7 @@ bool QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExt qreal dist = v2 / (accel * 2.0); if (v > 0) dist = -dist; - qreal target = qRound(data.move.value() - dist); + qreal target = -qRound(-(data.move.value() - dist)); dist = -target + data.move.value(); accel = v2 / (2.0f * qAbs(dist)); @@ -436,18 +436,18 @@ void QQuickFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal maxExt } else if (data.move.value() < maxExtent) { resetTimeline(data); adjustContentPos(data, maxExtent); - } else if (qRound(data.move.value()) != data.move.value()) { + } else if (-qRound(-data.move.value()) != data.move.value()) { // We could animate, but since it is less than 0.5 pixel it's probably not worthwhile. resetTimeline(data); qreal val = data.move.value(); - if (qAbs(qRound(val) - val) < 0.25) // round small differences - val = qRound(val); + if (qAbs(-qRound(-val) - val) < 0.25) // round small differences + val = -qRound(-val); else if (data.smoothVelocity.value() > 0) // continue direction of motion for larger - val = qFloor(val); + val = -qFloor(-val); else if (data.smoothVelocity.value() < 0) - val = qCeil(val); + val = -qCeil(-val); else // otherwise round - val = qRound(val); + val = -qRound(-val); timeline.set(data.move, val); } data.inOvershoot = false; @@ -1374,12 +1374,12 @@ void QQuickFlickablePrivate::replayDelayedPress() //XXX pixelAligned ignores the global position of the Flickable, i.e. assumes Flickable itself is pixel aligned. void QQuickFlickablePrivate::setViewportX(qreal x) { - contentItem->setX(pixelAligned ? qRound(x) : x); + contentItem->setX(pixelAligned ? -qRound(-x) : x); } void QQuickFlickablePrivate::setViewportY(qreal y) { - contentItem->setY(pixelAligned ? qRound(y) : y); + contentItem->setY(pixelAligned ? -qRound(-y) : y); } void QQuickFlickable::timerEvent(QTimerEvent *event) |