summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable.cpp4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgridview.cpp12
2 files changed, 12 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
index b3a34ed..cc0f905 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
@@ -613,7 +613,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
const qreal maxY = q->maxYExtent();
if (newY > minY)
newY = minY + (newY - minY) / 2;
- if (newY < maxY && maxY - minY < 0)
+ if (newY < maxY && maxY - minY <= 0)
newY = maxY + (newY - maxY) / 2;
if (!q->overShoot() && (newY > minY || newY < maxY)) {
if (newY > minY)
@@ -640,7 +640,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
const qreal maxX = q->maxXExtent();
if (newX > minX)
newX = minX + (newX - minX) / 2;
- if (newX < maxX && maxX - minX < 0)
+ if (newX < maxX && maxX - minX <= 0)
newX = maxX + (newX - maxX) / 2;
if (!q->overShoot() && (newX > minX || newX < maxX)) {
if (newX > minX)
diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
index 7e2d983..e36ea50 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
@@ -1138,7 +1138,11 @@ qreal QmlGraphicsGridView::maxYExtent() const
Q_D(const QmlGraphicsGridView);
if (d->flow == QmlGraphicsGridView::TopToBottom)
return QmlGraphicsFlickable::maxYExtent();
- return -(d->endPosition() - height());
+ qreal extent = -(d->endPosition() - height());
+ const qreal minY = minYExtent();
+ if (extent > minY)
+ extent = minY;
+ return extent;
}
qreal QmlGraphicsGridView::minXExtent() const
@@ -1154,7 +1158,11 @@ qreal QmlGraphicsGridView::maxXExtent() const
Q_D(const QmlGraphicsGridView);
if (d->flow == QmlGraphicsGridView::LeftToRight)
return QmlGraphicsFlickable::maxXExtent();
- return -(d->endPosition() - width());
+ qreal extent = -(d->endPosition() - width());
+ const qreal minX = minXExtent();
+ if (extent > minX)
+ extent = minX;
+ return extent;
}
void QmlGraphicsGridView::keyPressEvent(QKeyEvent *event)