From 3e9f45c5d585aabb1964e3472211c5201661eca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 7 May 2010 09:35:01 +0200 Subject: Fixed line and point drawing for the PS/PDF generators. Some lines and points could appear with artifacts when printed or viewed in a pdf viewer. If a brush was set we also generated a fill for the line/point, which was not correct. Task-number: QTBUG-8451 Reviewed-by: Gunnar --- src/gui/painting/qpdf.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index ee8b078..05341e3 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -971,12 +971,17 @@ void QPdfBaseEngine::drawPoints (const QPointF *points, int pointCount) if (!points) return; + Q_D(QPdfBaseEngine); QPainterPath p; for (int i=0; i!=pointCount;++i) { p.moveTo(points[i]); p.lineTo(points[i] + QPointF(0, 0.001)); } + + bool hadBrush = d->hasBrush; + d->hasBrush = false; drawPath(p); + d->hasBrush = hadBrush; } void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount) @@ -984,12 +989,16 @@ void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount) if (!lines) return; + Q_D(QPdfBaseEngine); QPainterPath p; for (int i=0; i!=lineCount;++i) { p.moveTo(lines[i].p1()); p.lineTo(lines[i].p2()); } + bool hadBrush = d->hasBrush; + d->hasBrush = false; drawPath(p); + d->hasBrush = hadBrush; } void QPdfBaseEngine::drawRects (const QRectF *rects, int rectCount) -- cgit v0.12