diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-04 17:50:07 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-04 17:53:49 (GMT) |
commit | e7c4967ec89cbc10dcc9127480532347264edca3 (patch) | |
tree | 1be1e0ce49869358f41b1c12c3528a7e5f33ba2b /src/gui/graphicsview/qgraphicsscene.cpp | |
parent | d7166584025d90dda52a859987f4dfaae12d6004 (diff) | |
download | Qt-e7c4967ec89cbc10dcc9127480532347264edca3.zip Qt-e7c4967ec89cbc10dcc9127480532347264edca3.tar.gz Qt-e7c4967ec89cbc10dcc9127480532347264edca3.tar.bz2 |
Make tst_QGraphicsEffectSource::boundingRect happy.
We cannot modify the transformPtr directly because we might want to
use the original transform later.
The problem in this particular case was that we called source->pixmap()
(which modified the transformPtr), then
source->boundingRect(Qt::DeviceCoordinates) which in turn used wrong
transform to map the bounding rect.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
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) |