diff options
author | John Brooks <john.brooks@dereferenced.net> | 2014-02-09 02:34:25 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-10 23:15:36 +0100 |
commit | 8efc7c190b7cd57c3285ba8fcb9e17ea8f4717c2 (patch) | |
tree | 79c4ac46ee6895f3fb49090f1640d967a7161708 /src/quick/items/qquickitemview.cpp | |
parent | 04fad1fc554efcf3cfb92cf1d6c223169d6a9342 (diff) |
Fix origin for short reversed item views
Reversed (BottomToTop and RightToLeft) item views would report an
impossible positive value for origin when contentHeight < height. The
correct value will be effectively equivalent to the position of the
footer, and always negative.
Match other logic using lastPosition() by negating its value for
reversed views.
This fixes a bug with content disappearing in a Controls ScrollView on
a BottomToTop view.
Change-Id: Ieedbb64ce8fc7c0fb36e5256e437ddeb3e757761
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickitemview.cpp')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 5d6fc534b4..e5b2ee822c 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -1381,7 +1381,7 @@ qreal QQuickItemView::originX() const if (d->layoutOrientation() == Qt::Horizontal && effectiveLayoutDirection() == Qt::RightToLeft && contentWidth() < width()) { - return d->lastPosition() - d->footerSize(); + return -d->lastPosition() - d->footerSize(); } return QQuickFlickable::originX(); } @@ -1392,7 +1392,7 @@ qreal QQuickItemView::originY() const if (d->layoutOrientation() == Qt::Vertical && d->verticalLayoutDirection == QQuickItemView::BottomToTop && contentHeight() < height()) { - return d->lastPosition() - d->footerSize(); + return -d->lastPosition() - d->footerSize(); } return QQuickFlickable::originY(); } |