diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-09 13:21:26 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-09 13:33:04 (GMT) |
commit | a23cab16dd4dd3505578d2747debaa28a21190ea (patch) | |
tree | 6acfb37f92388efcdd5b6b43a49315a668c38a63 /src/gui | |
parent | 99938908456a422ebced06744deec6333546bf6b (diff) | |
download | Qt-a23cab16dd4dd3505578d2747debaa28a21190ea.zip Qt-a23cab16dd4dd3505578d2747debaa28a21190ea.tar.gz Qt-a23cab16dd4dd3505578d2747debaa28a21190ea.tar.bz2 |
Fixed DeviceCoordinateCache items when using QGraphicsScene::render().
Since viewRect is null, we shouldn't try to use the partialCacheExposure
path which intersects the viewRect with the device rect of the item.
Task-number: QTBUG-15977
Reviewed-by: Bjørn Erik Nilsen
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index a0015dc..726e6d7 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4583,13 +4583,13 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte itemCache->exposed.clear(); deviceData->cacheIndent = QPoint(); pix = QPixmap(); - } else { + } else if (!viewRect.isNull()) { allowPartialCacheExposure = deviceData->cacheIndent != QPoint(); } // Allow partial cache exposure if the device rect isn't fully contained and // deviceRect is 20% taller or wider than the viewRect. - if (!allowPartialCacheExposure && !viewRect.contains(deviceRect)) { + if (!allowPartialCacheExposure && !viewRect.isNull() && !viewRect.contains(deviceRect)) { allowPartialCacheExposure = (viewRect.width() * 1.2 < deviceRect.width()) || (viewRect.height() * 1.2 < deviceRect.height()); } |