Fix drawing paths with constant opacity onto PDF

The native PDF strokes can not be used with constant opacity as any
overlapping parts of the path will end up being drawn multiple times
getting the wrong final opacity. A constant opacity should therefore
be treated the same as opacity on the pen color, and trigger the
fallback drawing.

Task-number: QTBUG-37101
Change-Id: I44f70a8b494567ee89804a5fa6333304a5abe91e
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This commit is contained in:
Allan Sandfeld Jensen 2014-03-28 12:56:39 +01:00 committed by The Qt Project
parent 8cde2faebc
commit f2e6570e4f

View File

@ -1059,7 +1059,7 @@ void QPdfEngine::drawPath (const QPainterPath &p)
if (!d->hasPen && !d->hasBrush)
return;
if (d->simplePen) {
if (d->simplePen && d->opacity == 1.0) {
// draw strokes natively in this case for better output
*d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath);
} else {