diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-06-08 12:49:44 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-09 07:43:37 (GMT) |
commit | 9ba5a561b017ec028d675627df2eda5b13e3a6fc (patch) | |
tree | 0b336556a4926f0fad6fc3e7a9beffb7e23d9e49 /src | |
parent | 56f23d4ccfc27f737d30e92ae5b3ecde6e8b0bbf (diff) | |
download | Qt-9ba5a561b017ec028d675627df2eda5b13e3a6fc.zip Qt-9ba5a561b017ec028d675627df2eda5b13e3a6fc.tar.gz Qt-9ba5a561b017ec028d675627df2eda5b13e3a6fc.tar.bz2 |
Fix two regressions in Plasma. The painter state proctection was not
properly pass to drawItemHelper.
The second is a double conversion to deviceTransform in createStyleOption
of QGraphicsItem. Since the recursive drawing already give a transform
in device mode we don't need to convert it two times.
Reviewed-by:andreas
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 6 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d962554..7f22c80 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1016,14 +1016,12 @@ void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, con return; // Initialize QStyleOptionGraphicsItem specific values (matrix, exposedRect). - - const QTransform itemToViewportTransform = q->deviceTransform(worldTransform); - option->matrix = itemToViewportTransform.toAffine(); //### discards perspective + option->matrix = worldTransform.toAffine(); //### discards perspective if (!allItems) { // Determine the item's exposed area option->exposedRect = QRectF(); - const QTransform reverseMap = itemToViewportTransform.inverted(); + const QTransform reverseMap = worldTransform.inverted(); const QVector<QRect> exposedRects(exposedRegion.rects()); for (int i = 0; i < exposedRects.size(); ++i) { option->exposedRect |= reverseMap.mapRect(exposedRects.at(i)); diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 1014550..28d65da 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5254,7 +5254,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (clipsToShape) painter->setClipPath(item->shape(), Qt::IntersectClip); painter->setOpacity(opacity); - drawItemHelper(item, painter, &styleOptionTmp, widget, false); + drawItemHelper(item, painter, &styleOptionTmp, widget, painterStateProtection); if (savePainter) painter->restore(); |