diff options
author | Andy Shaw <andy.shaw@nokia.com> | 2009-08-03 07:19:31 (GMT) |
---|---|---|
committer | Andy Shaw <andy.shaw@nokia.com> | 2009-08-03 07:19:31 (GMT) |
commit | 45005c68c6effa41108ef55cd10a84f5977f79a0 (patch) | |
tree | 5e702df906dc54ca99cda416936f5d6bb3fd5692 /src/gui/painting | |
parent | c386e433ff9e55bcf65abf9eee665ad4237fbd33 (diff) | |
download | Qt-45005c68c6effa41108ef55cd10a84f5977f79a0.zip Qt-45005c68c6effa41108ef55cd10a84f5977f79a0.tar.gz Qt-45005c68c6effa41108ef55cd10a84f5977f79a0.tar.bz2 |
Ensure that the dash offset is reset when using drawLines()
When using drawLines() then the dash offset was remembering where it
was on the previous line. This is not what the behaviour should be
as it should be starting with the same offset for each line.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 69e490a..74456dd 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1736,6 +1736,8 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) const QLineF *lines = reinterpret_cast<const QLineF *>(path.points()); for (int i = 0; i < lineCount; ++i) { + if (path.shape() == QVectorPath::LinesHint) + dashOffset = s->lastPen.dashOffset(); if (lines[i].p1() == lines[i].p2()) { if (s->lastPen.capStyle() != Qt::FlatCap) { QPointF p = lines[i].p1(); @@ -3454,8 +3456,8 @@ void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount) int m22 = int(s->matrix.m22()); int dx = qFloor(s->matrix.dx() + aliasedCoordinateDelta); int dy = qFloor(s->matrix.dy() + aliasedCoordinateDelta); - int dashOffset = int(s->lastPen.dashOffset()); for (int i=0; i<lineCount; ++i) { + int dashOffset = int(s->lastPen.dashOffset()); if (s->flags.int_xform) { const QLine &l = lines[i]; int x1 = l.x1() * m11 + dx; @@ -3554,8 +3556,8 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount) ? LineDrawNormal : LineDrawIncludeLastPixel; - int dashOffset = int(s->lastPen.dashOffset()); for (int i=0; i<lineCount; ++i) { + int dashOffset = int(s->lastPen.dashOffset()); QLineF line = (lines[i] * s->matrix).translated(aliasedCoordinateDelta, aliasedCoordinateDelta); const QRectF brect(QPointF(line.x1(), line.y1()), QPointF(line.x2(), line.y2())); |