diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-01-25 10:02:16 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:58 (GMT) |
commit | e483f2c65139d7004ba35768340adecf23319eb8 (patch) | |
tree | 4e3c1405c74d9628c76b7d868221caf8fc8c10c3 /src | |
parent | 00dfa90f9f2fef1f29fd356c488da5e156f20227 (diff) | |
download | Qt-e483f2c65139d7004ba35768340adecf23319eb8.zip Qt-e483f2c65139d7004ba35768340adecf23319eb8.tar.gz Qt-e483f2c65139d7004ba35768340adecf23319eb8.tar.bz2 |
Fixed QPainterPath::pointAtPercent(t) for one-element paths.
Return the MoveTo element instead of QPointF(0, 0).
Task-number: QTBUG-16788
Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index b0515cc..453726f 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2915,9 +2915,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; |