diff options
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 4 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 15 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene_p.h | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index c01ee1a..76c9dab 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -516,7 +516,7 @@ struct QGraphicsItemPrivate::TransformData { struct QGraphicsItemPaintInfo { - inline QGraphicsItemPaintInfo(const QTransform *const xform1, QTransform *xform2, + inline QGraphicsItemPaintInfo(const QTransform *const xform1, const QTransform *const xform2, QRegion *r, QWidget *w, QStyleOptionGraphicsItem *opt, QPainter *p, qreal o, bool b1, bool b2) : viewTransform(xform1), transformPtr(xform2), exposedRegion(r), widget(w), @@ -524,7 +524,7 @@ struct QGraphicsItemPaintInfo {} const QTransform *viewTransform; - QTransform *transformPtr; + const QTransform *transformPtr; QRegion *exposedRegion; QWidget *widget; QStyleOptionGraphicsItem *option; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index ddd2550..c898a3e 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4366,8 +4366,9 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * } void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const QTransform *const viewTransform, - QTransform *transformPtr, QRegion *exposedRegion, QWidget *widget, qreal opacity, - const QTransform *effectTransform, bool wasDirtyParentSceneTransform, bool drawItem) + const QTransform *const transformPtr, QRegion *exposedRegion, QWidget *widget, + qreal opacity, const QTransform *effectTransform, + bool wasDirtyParentSceneTransform, bool drawItem) { const bool itemIsFullyTransparent = (opacity < 0.0001); const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape); @@ -4381,8 +4382,9 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q painter->save(); Q_ASSERT(transformPtr); if (effectTransform) - *transformPtr *= *effectTransform; - painter->setWorldTransform(*transformPtr); + painter->setWorldTransform(*transformPtr * *effectTransform); + else + painter->setWorldTransform(*transformPtr); painter->setClipPath(item->shape(), Qt::IntersectClip); } @@ -4414,8 +4416,9 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q if (!itemHasChildren || !itemClipsChildrenToShape) { if (effectTransform) - *transformPtr *= *effectTransform; - painter->setWorldTransform(*transformPtr); + painter->setWorldTransform(*transformPtr * *effectTransform); + else + painter->setWorldTransform(*transformPtr); } if (itemClipsToShape) diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 6223101..0422124 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -204,7 +204,7 @@ public: void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform *const, QRegion *exposedRegion, QWidget *widget, qreal parentOpacity = qreal(1.0), const QTransform *const effectTransform = 0); - void draw(QGraphicsItem *, QPainter *, const QTransform *const, QTransform *, + void draw(QGraphicsItem *, QPainter *, const QTransform *const, const QTransform *const, QRegion *, QWidget *, qreal, const QTransform *const, bool, bool); void markDirty(QGraphicsItem *item, const QRectF &rect = QRectF(), bool invalidateChildren = false, |