diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-11-09 15:32:01 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-11-16 15:21:31 (GMT) |
commit | 8c026965779aa43c519f91a97495d0864ec3bc26 (patch) | |
tree | e618b446d71c8075b203dbe622bb52fe286ece2f | |
parent | 8ccb78916cbf1ca7398aa4d71df9d2d770654d82 (diff) | |
download | Qt-8c026965779aa43c519f91a97495d0864ec3bc26.zip Qt-8c026965779aa43c519f91a97495d0864ec3bc26.tar.gz Qt-8c026965779aa43c519f91a97495d0864ec3bc26.tar.bz2 |
Fixed handling of stroke-dashoffset in the SVG module.
When stroke-dashoffset was set on a solid stroke
(stroke-dasharray="none"), the path was not painted.
QPen::setDashOffset() automatically sets the pen's style to
CustomDashLine, so if there is no dash array, nothing is drawn. The fix
is to avoid calling QPen::setDashOffset() when the pen is solid.
Task-number: QTBUG-5609
Reviewed-by: Tor Arne
(cherry picked from commit dd34feda9c0ec23f3aef6863ce71b15b57aeba7d)
-rw-r--r-- | src/svg/qsvgstyle.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index f834016..57927fd 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -363,7 +363,10 @@ void QSvgStrokeStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraSt if (m_strokeMiterLimitSet) pen.setMiterLimit(m_stroke.miterLimit()); - if (setDashOffsetNeeded) { + // You can have dash offset on solid strokes in SVG files, but not in Qt. + // QPen::setDashOffset() will set the pen style to Qt::CustomDashLine, + // so don't call the method if the pen is solid. + if (setDashOffsetNeeded && pen.style() != Qt::SolidLine) { qreal currentWidth = pen.widthF(); if (currentWidth == 0) currentWidth = 1; |