From 50482f69af0b9392424dfdad5376fcb09be36d46 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 9 May 2012 11:25:31 +1000 Subject: 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 --- tests/auto/quick/qquickanchors/tst_qquickanchors.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/auto/quick/qquickanchors/tst_qquickanchors.cpp') 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(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(view->rootObject(), QLatin1String("centered3")); + QCOMPARE(rect3->x(), 94.5); + QCOMPARE(rect3->y(), 94.5); delete view; } -- cgit v1.2.3