diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-11-09 15:32:01 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-11-09 15:53:27 (GMT) |
commit | dd34feda9c0ec23f3aef6863ce71b15b57aeba7d (patch) | |
tree | f513a4d7e095566b1e25a2d2ee6e671b9f88fc58 /src/svg/qsvgstyle.cpp | |
parent | 371a407618fad14beca8985e4c8c4f85add4d3e1 (diff) | |
download | Qt-dd34feda9c0ec23f3aef6863ce71b15b57aeba7d.zip Qt-dd34feda9c0ec23f3aef6863ce71b15b57aeba7d.tar.gz Qt-dd34feda9c0ec23f3aef6863ce71b15b57aeba7d.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
Diffstat (limited to 'src/svg/qsvgstyle.cpp')
-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; |