aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-05-09 11:25:31 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-11 07:22:25 +0200
commit50482f69af0b9392424dfdad5376fcb09be36d46 (patch)
tree5d0cbc6f95d28d03c82e0bf0dc96b4755e7877ce /tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
parent67fb05034c9758d25464f2103ae6068dbc9bb110 (diff)
Make unaligned centered alignment optional.
Centered alignment was recently made unaligned by e99c5a3f113bbc1b8f8db996b4b0d5715eea2d89. This has the side-effect of sometimes making items appear fuzzy due to sub-pixel alignment. Since we have two conflicting goals, make this behavior configuarable. Change-Id: I5ed0e9532a64f4a986d148044f5871a7ec970f5f Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickanchors/tst_qquickanchors.cpp')
-rw-r--r--tests/auto/quick/qquickanchors/tst_qquickanchors.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
index 7b748f6191..544fb4ba12 100644
--- a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
+++ b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
@@ -545,10 +545,15 @@ void tst_qquickanchors::centerIn()
QCOMPARE(rect->x(), 75.0 - 20.0);
QCOMPARE(rect->y(), 75.0 - 10.0);
- //QTBUG-21730 (use actual center to prevent animation jitter)
+ // By default center aligned to pixel
QQuickRectangle* rect2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("centered2"));
- QCOMPARE(rect2->x(), 94.5);
- QCOMPARE(rect2->y(), 94.5);
+ QCOMPARE(rect2->x(), 94.0);
+ QCOMPARE(rect2->y(), 94.0);
+
+ //QTBUG-21730 (use actual center to prevent animation jitter)
+ QQuickRectangle* rect3 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("centered3"));
+ QCOMPARE(rect3->x(), 94.5);
+ QCOMPARE(rect3->y(), 94.5);
delete view;
}