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 <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2017-12-12 17:12:56 +01:00
parent 1d2049bffc
commit c9d2453a4d

View File

@@ -86,7 +86,7 @@ void FormEditorItem::setup()
QRectF FormEditorItem::boundingRect() const QRectF FormEditorItem::boundingRect() const
{ {
return m_boundingRect; return m_boundingRect.adjusted(-2, -2, 2, 2);
} }
QPainterPath FormEditorItem::shape() const QPainterPath FormEditorItem::shape() const
@@ -338,7 +338,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
if (isInStackedContainer) if (isInStackedContainer)
showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible(); showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible();
painter->setClipRegion(m_boundingRect.toRect()); painter->setClipRegion(boundingRect().toRect());
painter->setClipping(true); painter->setClipping(true);
if (!hideCompletely) { if (!hideCompletely) {