summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-07 09:41:10 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:06:10 (GMT)
commita8bdabd1c8538f43a17a64ccc93d3df604d18bae (patch)
treecf68ce58024998e1d192cbb69e778e92b6173326 /tests/auto
parent74a67cfb47726008e9bb0acc34bb733132f4242f (diff)
downloadQt-a8bdabd1c8538f43a17a64ccc93d3df604d18bae.zip
Qt-a8bdabd1c8538f43a17a64ccc93d3df604d18bae.tar.gz
Qt-a8bdabd1c8538f43a17a64ccc93d3df604d18bae.tar.bz2
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/auto')
-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 346ec3f..14ec8a5 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)