summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-07 11:41:10 +0200
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 13:06:10 +0300
commita8bdabd1c8538f43a17a64ccc93d3df604d18bae (patch)
treecf68ce58024998e1d192cbb69e778e92b6173326 /tests
parent74a67cfb47726008e9bb0acc34bb733132f4242f (diff)
Fix QTransform::map(const QPainterPath &) not working with paths that
have only one element Replaced the isEmpty() check for the shortcut in map() with elementCount() == 0 Task-number: QTBUG-11264 Reviewed-by: Samuel (cherry picked from commit 90e009e9e273a4fea5166007e4c2b0638c6588cd)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtransform/tst_qtransform.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp
index 346ec3f978..14ec8a59bf 100644
--- a/tests/auto/qtransform/tst_qtransform.cpp
+++ b/tests/auto/qtransform/tst_qtransform.cpp
@@ -85,6 +85,7 @@ private slots:
void inverted();
void projectivePathMapping();
void mapInt();
+ void mapPathWithPoint();
private:
void mapping_data();
@@ -793,6 +794,13 @@ void tst_QTransform::mapInt()
QCOMPARE(y, 10);
}
+void tst_QTransform::mapPathWithPoint()
+{
+ QPainterPath p(QPointF(10, 10));
+ p = QTransform::fromTranslate(10, 10).map(p);
+ QCOMPARE(p.currentPosition(), QPointF(20, 20));
+}
+
QTEST_APPLESS_MAIN(tst_QTransform)