Avoid multiple transformation of the clip path
The painter saves existing paint engine state in the stack and restore back to the previous state after performing required paint operation. The clip path stored as part of paint engine state is getting translated more than once during save and restore operation. This multiple transformation of the same clip path causes incorrect translation within the plane. To fix this issue, during restore, remove translation of clip path with redirection matrix. Fixes: QTBUG-109518 Change-Id: I1509bc7fa4965f2802bce62c1ed27cdb90da617a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 4e4d37f0472c58ff6c98e9852691b1ccda8beffb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
dd92e01f45
commit
a06980b999
@ -1618,7 +1618,6 @@ void QPainter::restore()
|
|||||||
// replay the list of clip states,
|
// replay the list of clip states,
|
||||||
for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) {
|
for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) {
|
||||||
tmp->matrix = info.matrix;
|
tmp->matrix = info.matrix;
|
||||||
tmp->matrix *= d->state->redirectionMatrix;
|
|
||||||
tmp->clipOperation = info.operation;
|
tmp->clipOperation = info.operation;
|
||||||
if (info.clipType == QPainterClipInfo::RectClip) {
|
if (info.clipType == QPainterClipInfo::RectClip) {
|
||||||
tmp->dirtyFlags = QPaintEngine::DirtyClipRegion | QPaintEngine::DirtyTransform;
|
tmp->dirtyFlags = QPaintEngine::DirtyClipRegion | QPaintEngine::DirtyTransform;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user