diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-07 09:41:10 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:06:10 (GMT) |
commit | a8bdabd1c8538f43a17a64ccc93d3df604d18bae (patch) | |
tree | cf68ce58024998e1d192cbb69e778e92b6173326 /tests | |
parent | 74a67cfb47726008e9bb0acc34bb733132f4242f (diff) | |
download | Qt-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')
-rw-r--r-- | tests/auto/qtransform/tst_qtransform.cpp | 8 |
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) |