summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2018-06-06 15:22:52 +0200
committerAndre de la Rocha <andre.rocha@qt.io>2018-06-06 16:54:20 +0000
commitb72a9cbaaf7d49a1813c3b1926a68e05f47f350a (patch)
treefa0c08735dca12ec42438c01794039890eaa2eeb
parentbf1f17364f6c1f548715acf69023f511492682f3 (diff)
Fix PDF rendering of strokes with cosmetic pens
The PDF backend was ignoring the cosmetic attribute for certain pens, resulting in strokes rendered incorrectly. Task-number: QTBUG-68537 Change-Id: Ib9fd5a510716056c8afe67733f51fc682bbb7354 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--src/gui/painting/qpdf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index e58f9cee4c..4fd0d3c8fe 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1109,8 +1109,9 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
d->hasPen = d->pen.style() != Qt::NoPen;
d->stroker.setPen(d->pen, state.renderHints());
QBrush penBrush = d->pen.brush();
+ bool cosmeticPen = qt_pen_is_cosmetic(d->pen, state.renderHints());
bool oldSimple = d->simplePen;
- d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0);
+ d->simplePen = (d->hasPen && !cosmeticPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0);
if (oldSimple != d->simplePen)
flags |= DirtyTransform;
} else if (flags & DirtyHints) {