aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@qinetic.com.au>2015-03-09 16:47:16 +1000
committerAndrew den Exter <andrew.den.exter@qinetic.com.au>2015-03-11 02:54:37 +0000
commit61cfaee2d0e4ae106a00950e917b712a52049d6f (patch)
treeb3d63cccd27862789e5b1df3496eafa21afc5ec7 /src/quick
parentd517346086226493e63ffd1b92bae4fb86ed3024 (diff)
Fix flickable stealing gestures when height >= contentHeight.
Or width >= contentWidth. If newY is equal to both maxY and minY then the second assignment to rejectY can clobber the first. Changing the second assignment to an |= means rejectY is true if either is true. Secondly maxY became positive when height was greater than contentHeight instead of having a maximum of 0, which ensured rejectY evaluated to false in the case newY <= maxY and the mouse was stolen. Change-Id: I6416d0e23c3ef898887a7b3e3fcdc1dc12853548 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickflickable.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 9c03a6db28..a9396051ab 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1041,7 +1041,7 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
if (fuzzyLessThanOrEqualTo(minY, newY)) {
newY = minY;
- rejectY = vData.pressPos == minY && vData.move.value() == minY && dy > 0;
+ rejectY |= vData.pressPos == minY && vData.move.value() == minY && dy > 0;
}
} else {
qreal vel = velocity.y() / QML_FLICK_OVERSHOOTFRICTION;
@@ -1101,7 +1101,7 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
}
if (fuzzyLessThanOrEqualTo(minX, newX)) {
newX = minX;
- rejectX = hData.pressPos == minX && hData.move.value() == minX && dx > 0;
+ rejectX |= hData.pressPos == minX && hData.move.value() == minX && dx > 0;
}
} else {
qreal vel = velocity.x() / QML_FLICK_OVERSHOOTFRICTION;
@@ -1527,13 +1527,13 @@ qreal QQuickFlickable::minXExtent() const
qreal QQuickFlickable::maxXExtent() const
{
Q_D(const QQuickFlickable);
- return width() - vWidth() - d->hData.endMargin;
+ return qMin<qreal>(0, width() - vWidth() - d->hData.endMargin);
}
/* returns -ve */
qreal QQuickFlickable::maxYExtent() const
{
Q_D(const QQuickFlickable);
- return height() - vHeight() - d->vData.endMargin;
+ return qMin<qreal>(0, height() - vHeight() - d->vData.endMargin);
}
void QQuickFlickable::componentComplete()