From 8efc7c190b7cd57c3285ba8fcb9e17ea8f4717c2 Mon Sep 17 00:00:00 2001 From: John Brooks Date: Sun, 9 Feb 2014 02:34:25 -0700 Subject: 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 --- src/quick/items/qquickitemview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3