summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvgstyle.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-09 16:32:01 +0100
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-09 16:53:27 +0100
commitdd34feda9c0ec23f3aef6863ce71b15b57aeba7d (patch)
treef513a4d7e095566b1e25a2d2ee6e671b9f88fc58 /src/svg/qsvgstyle.cpp
parent371a407618fad14beca8985e4c8c4f85add4d3e1 (diff)
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.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index f834016abf..57927fdca6 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;