summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Niekamp <pniekamp@gmail.com>2014-11-13 19:37:00 +1100
committerLars Knoll <lars.knoll@digia.com>2015-02-11 18:35:36 +0000
commit32957d8893fa3b739c29be76869a9e8e1e63931b (patch)
tree5b5b490bf468a9730bf6d048613549bd984ee21b /src
parent838212b8e692add300774ffb012dc90342a3130e (diff)
Fix regression in opacity handling of pdf path stroke
Specifically when rendering svg to a pdf, when painter opacity is set, path strokes were transformed incorrectly due to missed setting of dirtyTransform flag. Task-number: QTBUG-38675 Change-Id: I861353822ccddd394910b8612687a244d195a41e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpdf.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 473231b142..9aca4040a5 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1051,7 +1051,7 @@ void QPdfEngine::drawPath (const QPainterPath &p)
if (!d->hasPen && !d->hasBrush)
return;
- if (d->simplePen && d->opacity == 1.0) {
+ if (d->simplePen) {
// draw strokes natively in this case for better output
*d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath);
} else {
@@ -1198,7 +1198,7 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
d->stroker.setPen(d->pen, state.renderHints());
QBrush penBrush = d->pen.brush();
bool oldSimple = d->simplePen;
- d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque());
+ d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0);
if (oldSimple != d->simplePen)
flags |= DirtyTransform;
} else if (flags & DirtyHints) {
@@ -1214,8 +1214,13 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
d->brushOrigin = state.brushOrigin();
flags |= DirtyBrush;
}
- if (flags & DirtyOpacity)
+ if (flags & DirtyOpacity) {
d->opacity = state.opacity();
+ if (d->simplePen && d->opacity != 1.0) {
+ d->simplePen = false;
+ flags |= DirtyTransform;
+ }
+ }
bool ce = d->clipEnabled;
if (flags & DirtyClipPath) {