summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-09 15:32:01 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-09 15:53:27 (GMT)
commitdd34feda9c0ec23f3aef6863ce71b15b57aeba7d (patch)
treef513a4d7e095566b1e25a2d2ee6e671b9f88fc58 /src
parent371a407618fad14beca8985e4c8c4f85add4d3e1 (diff)
downloadQt-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')
-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 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;