diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-26 17:54:40 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-26 17:54:40 (GMT) |
commit | 69c9b5b45393ebd2e2e50f1bb316cf4fc8ee9b73 (patch) | |
tree | 681d8cd0d2ba4630363a1d65e5d7d91543774521 | |
parent | faf129a7c4f49458261ed174890602d290d1a9c2 (diff) | |
parent | 872d6d713d4c0d61308b51bf781f5b44763d927b (diff) | |
download | Qt-69c9b5b45393ebd2e2e50f1bb316cf4fc8ee9b73.zip Qt-69c9b5b45393ebd2e2e50f1bb316cf4fc8ee9b73.tar.gz Qt-69c9b5b45393ebd2e2e50f1bb316cf4fc8ee9b73.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging:
Fixed a stupid typo
Fixed QPainterPath::pointAtPercent(t) for one-element paths.
-rw-r--r-- | examples/scroller/plot/main.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 5 | ||||
-rw-r--r-- | tests/auto/qpainterpath/tst_qpainterpath.cpp | 5 |
3 files changed, 10 insertions, 2 deletions
diff --git a/examples/scroller/plot/main.cpp b/examples/scroller/plot/main.cpp index 6166505..1e7db64 100644 --- a/examples/scroller/plot/main.cpp +++ b/examples/scroller/plot/main.cpp @@ -214,7 +214,7 @@ int main(int argc, char **argv) else mw.show(); #if defined(Q_WS_MAC) - mw->raise(); + mw.raise(); #endif return a.exec(); } diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 9f49b2f..3d532d2 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2923,9 +2923,12 @@ QPointF QPainterPath::pointAtPercent(qreal t) const return QPointF(); } - if (isEmpty()) + if (!d_ptr || d_ptr->elements.size() == 0) return QPointF(); + if (d_ptr->elements.size() == 1) + return d_ptr->elements.at(0); + qreal totalLength = length(); qreal curLen = 0; qreal bezierLen = 0; diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index fb3a4ea..8382edc 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -1044,6 +1044,11 @@ void tst_QPainterPath::pointAtPercent_data() QRectF rect(241, 273, 185, 228); path.addEllipse(rect); QTest::newRow("Case 17") << path << qreal(1.0) << QPointF(rect.right(), qreal(0.5) * (rect.top() + rect.bottom())); + + path = QPainterPath(); + path.moveTo(100, 100); + QTest::newRow("Case 18") << path << qreal(0.0) << QPointF(100, 100); + QTest::newRow("Case 19") << path << qreal(1.0) << QPointF(100, 100); } void tst_QPainterPath::pointAtPercent() |