From 2a546690bf457f4bfee0910ba979441511843f8b Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 1 Oct 2021 10:30:38 +0200 Subject: [PATCH] Support transformations in pattern/texture brushes in pdf The brush transform was ignored for pattern/texture brushes. Since fill patterns always have a transform in pdf anyway, we can just multiply in the brush transform. Fixes: QTBUG-96978 Pick-to: 6.2 Change-Id: I80357f61fb879dfb1226d4ef9469ae5c9a9c1147 Reviewed-by: Lars Knoll Reviewed-by: Albert Astals Cid --- src/gui/painting/qpdf.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index d3d7483cd0..2d25b5811e 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2760,6 +2760,8 @@ int QPdfEnginePrivate::addBrushPattern(const QTransform &m, bool *specifyColor, return gradientBrush(brush, matrix, gStateObject); } + matrix = brush.transform() * matrix; + if ((!brush.isOpaque() && brush.style() < Qt::LinearGradientPattern) || opacity != 1.0) *gStateObject = addConstantAlphaObject(qRound(brush.color().alpha() * opacity), qRound(pen.color().alpha() * opacity));