From a06980b999ebaa1fe016cdb6a21dfc1ed7f94e85 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Date: Mon, 30 Jan 2023 12:23:28 +0100 Subject: [PATCH] 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 (cherry picked from commit 4e4d37f0472c58ff6c98e9852691b1ccda8beffb) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qpainter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 9dd37787561..e69f369dbed 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1618,7 +1618,6 @@ void QPainter::restore() // replay the list of clip states, for (const QPainterClipInfo &info : std::as_const(d->state->clipInfo)) { tmp->matrix = info.matrix; - tmp->matrix *= d->state->redirectionMatrix; tmp->clipOperation = info.operation; if (info.clipType == QPainterClipInfo::RectClip) { tmp->dirtyFlags = QPaintEngine::DirtyClipRegion | QPaintEngine::DirtyTransform;