aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext/tst_qquicktext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 6c0da40b8e..6f7d494255 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -2771,18 +2771,19 @@ void tst_qquicktext::lineLaidOutRelayout()
QVERIFY(!textPrivate->extra.isAllocated());
- qreal maxH = 0;
+ qreal y = 0.0;
for (int i = 0; i < textPrivate->layout.lineCount(); ++i) {
QTextLine line = textPrivate->layout.lineAt(i);
const QRectF r = line.rect();
- const qreal h = line.height();
if (r.x() == 0) {
- QCOMPARE(r.y(), i * h);
- maxH = qMax(maxH, r.y() + h);
+ QCOMPARE(r.y(), y);
} else {
+ if (qFuzzyIsNull(r.y()))
+ y = 0.0;
QCOMPARE(r.x(), myText->width() / 2);
- QCOMPARE(r.y(), i * h - maxH);
+ QCOMPARE(r.y(), y);
}
+ y += line.height();
}
}