summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdf.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-07 07:35:01 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-07 07:42:06 (GMT)
commit3e9f45c5d585aabb1964e3472211c5201661eca3 (patch)
tree842b5c9f601c098a8660e3f6d98392a4d9db5fe9 /src/gui/painting/qpdf.cpp
parent18411bfd474b05fd427b3d763af2fcc96e3e73df (diff)
downloadQt-3e9f45c5d585aabb1964e3472211c5201661eca3.zip
Qt-3e9f45c5d585aabb1964e3472211c5201661eca3.tar.gz
Qt-3e9f45c5d585aabb1964e3472211c5201661eca3.tar.bz2
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/painting/qpdf.cpp')
-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 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)