aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2020-04-28 19:37:32 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2020-04-29 08:36:18 +0000
commit934a7188d61fe1df821a313e4e8d8c46da2cabd3 (patch)
treea58c6d6dcc844385942f5eaca96257aeb996ee84 /src/plugins/qmldesigner
parent39249bd91dbc0c18439c54e19d0755c4b186aadc (diff)
QmlDesigner: Fix clipping issues
Always clip the instanceRenderPixmap against the bounding rectangle. Sometimes the bouding rectangle is updated after the pixmap. Painting outside of the bounding rectangle creates artefacts. Task-number: QDS-1945 Change-Id: I496c4436780eb0455df968d0d30ca2682e93a9ff Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner')
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index 337cc0f7fc..37d9aa26f0 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -443,6 +443,8 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
|| painterTransform.isRotating())
painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
+ painter->setClipRegion(boundingRect().toRect());
+
if (m_blurContent)
painter->drawPixmap(m_paintedBoundingRect.topLeft(), qmlItemNode().instanceBlurredRenderPixmap());
else
@@ -452,6 +454,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
}
}
+ painter->setClipping(false);
if (!qmlItemNode().isRootModelNode())
paintBoundingRect(painter);