summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp7
-rw-r--r--tests/auto/other/lancelot/scripts/linedashes.qps40
2 files changed, 44 insertions, 3 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 10920c38fe..5b7f8511ba 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1713,8 +1713,11 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
width / line.length(),
s->lastPen.capStyle() == Qt::SquareCap);
} else {
- d->rasterizeLine_dashed(line, width,
- &dashIndex, &dashOffset, &inDash);
+ // LinesHint means each line is distinct, so restart dashing
+ int dIndex = dashIndex;
+ qreal dOffset = dashOffset;
+ bool inD = inDash;
+ d->rasterizeLine_dashed(line, width, &dIndex, &dOffset, &inD);
}
}
}
diff --git a/tests/auto/other/lancelot/scripts/linedashes.qps b/tests/auto/other/lancelot/scripts/linedashes.qps
index ee7d18b156..78c791e68b 100644
--- a/tests/auto/other/lancelot/scripts/linedashes.qps
+++ b/tests/auto/other/lancelot/scripts/linedashes.qps
@@ -91,4 +91,42 @@ translate 100 0
repeat_block draw_lines
setPen 0xffff0000 0 dashline squarecap
translate 100 0
-repeat_block draw_lines \ No newline at end of file
+repeat_block draw_lines
+
+path_moveTo mypath 10 10
+path_lineTo mypath 87 10
+path_moveTo mypath 10 30
+path_lineTo mypath 87 30
+path_moveTo mypath 10 50
+path_lineTo mypath 87 50
+
+resetMatrix
+translate 0 150
+
+begin_block distinctLines
+
+setPen black 0 SolidLine SquareCap
+pen_setDashPattern [ 3 3 ]
+drawPath mypath
+
+translate 100 0
+setPen black 5 SolidLine SquareCap
+pen_setDashPattern [ 3 3 ]
+drawPath mypath
+
+translate 100 0
+setPen black 0 SolidLine RoundCap
+pen_setDashPattern [ 3 3 ]
+drawPath mypath
+
+translate 100 0
+setPen black 5 SolidLine RoundCap
+pen_setDashPattern [ 3 3 ]
+drawPath mypath
+
+end_block distinctLines
+
+resetMatrix
+translate 0 220
+setRenderHint Antialiasing true
+repeat_block distinctLines