aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-11-09 09:06:39 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-09 08:23:57 +0100
commit15547ac366bdfd6f35779995b5d56df669b5e564 (patch)
treeebcd79f011e34992eca28f3a387fc9b80119fc2f /src
parent89eea1765625c59a4362e600e4e0f99f261706bc (diff)
tst_QSGGridView enforceRange_rightToLeft fails
Change 9bd6361400a2a4e4045a090de73d70082cc6d1bf corrected the highlight range for right to left layout, i.e. positioned relative to the right. This change fixes the autotest to account for this and fixes flicking in StrictlyEnforceRange mode with RTL layout. Task-number: QTBUG-22162 Change-Id: I133b7e647883e51783bcf54111871451a3a7e67f Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/items/qquickgridview.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/declarative/items/qquickgridview.cpp b/src/declarative/items/qquickgridview.cpp
index a194772a1e..2793032a48 100644
--- a/src/declarative/items/qquickgridview.cpp
+++ b/src/declarative/items/qquickgridview.cpp
@@ -335,9 +335,6 @@ qreal QQuickGridViewPrivate::snapPosAt(qreal pos) const
qreal snapPos = 0;
if (!visibleItems.isEmpty()) {
qreal highlightStart = highlightRangeStart;
- if (isRightToLeftTopToBottom())
- highlightStart = highlightRangeEndValid ? -size() + highlightRangeEnd : -size();
-
pos += highlightStart;
pos += rowSize()/2;
snapPos = static_cast<FxGridItemSG*>(visibleItems.first())->rowPos() - visibleIndex / columns * rowSize();
@@ -346,8 +343,8 @@ qreal QQuickGridViewPrivate::snapPosAt(qreal pos) const
qreal maxExtent;
qreal minExtent;
if (isRightToLeftTopToBottom()) {
- maxExtent = q->minXExtent();
- minExtent = q->maxXExtent();
+ maxExtent = q->minXExtent()-size();
+ minExtent = q->maxXExtent()-size();
} else {
maxExtent = flow == QQuickGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
minExtent = flow == QQuickGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();