Commit 732d5ec7 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.QmlPuppet: fix for clipping in sub items



We did not clip sub items if clipping was enabled.

Task-number: QTCREATORBUG-9604
Change-Id: I75fdabd86193fbfbf397bf3d119a1a33c72cf771
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 61e7641a
......@@ -30,6 +30,7 @@
#include "graphicsobjectnodeinstance.h"
#include <QGraphicsObject>
#include <QDeclarativeItem>
#include "private/qgraphicsitem_p.h"
#include <private/qdeclarativemetatype_p.h>
......@@ -302,6 +303,11 @@ void GraphicsObjectNodeInstance::paintRecursively(QGraphicsItem *graphicsItem, Q
painter->save();
painter->setTransform(graphicsItem->itemTransform(graphicsItem->parentItem()), true);
painter->setOpacity(graphicsItem->opacity() * painter->opacity());
QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem *>(graphicsItem);
if (declarativeItem && declarativeItem->clip())
painter->setClipRect(declarativeItem->boundingRect());
QStyleOptionGraphicsItem option;
initOption(graphicsItem, &option, painter->transform());
graphicsItem->paint(painter, &option);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment