diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-05-20 16:47:42 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-05-31 21:20:41 +0200 |
commit | 5adaa8d868b6718e07035152351b14449cea95d3 (patch) | |
tree | 3b08ac3e7db2c9c0850c8026dcad0a53a4dc33bf /src/gui/image | |
parent | 5e48a51608485cbc87b68498fd54ab36f001d584 (diff) |
Add painter render hint for brush pattern transformation
[ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns
would always be transformed along with the object being painted. In Qt
6.0 onwards, they would or would not, depending on the
SmoothPixmapTransformation render hint. Instead of this somewhat
surprising behavior, make the default be untransformed
(i.e. cosmetic), which makes sense when it comes to dpr scaling. For
the cases where one wants scaling, a new render hint is introduced to
enable that: NonCosmeticPatternBrushes.
Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpicture.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 3f4dec37d5..da8c5ef1e5 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -814,6 +814,8 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords) bool(ul & QPainter::Antialiasing)); painter->setRenderHint(QPainter::SmoothPixmapTransform, bool(ul & QPainter::SmoothPixmapTransform)); + painter->setRenderHint(QPainter::NonCosmeticBrushPatterns, + bool(ul & QPainter::NonCosmeticBrushPatterns)); break; case QPicturePrivate::PdcSetCompositionMode: s >> ul; |