From c9d2453a4df347f0500340d7e21cd9219b1d5549 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 12 Dec 2017 17:12:56 +0100 Subject: [PATCH] QmlDesigner: Increase the bounding rectangle Since we clip against the bounding rectangle we increase the size a bit. This ensures we do not get painting artefacts if something is 1 or 2 pixels off. Change-Id: I4d9c40dd25aaa4469b568df914a1290f21790271 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/formeditor/formeditoritem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index 54d5d1536dc..d6bd69ed2cd 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -86,7 +86,7 @@ void FormEditorItem::setup() QRectF FormEditorItem::boundingRect() const { - return m_boundingRect; + return m_boundingRect.adjusted(-2, -2, 2, 2); } QPainterPath FormEditorItem::shape() const @@ -338,7 +338,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, if (isInStackedContainer) showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible(); - painter->setClipRegion(m_boundingRect.toRect()); + painter->setClipRegion(boundingRect().toRect()); painter->setClipping(true); if (!hideCompletely) {