summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-07 09:35:01 +0200
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-07 09:42:06 +0200
commit3e9f45c5d585aabb1964e3472211c5201661eca3 (patch)
tree842b5c9f601c098a8660e3f6d98392a4d9db5fe9 /src/gui
parent18411bfd474b05fd427b3d763af2fcc96e3e73df (diff)
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpdf.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index ee8b078fc1..05341e33f7 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)