summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-02-27 17:10:08 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:36 (GMT)
commitb4456f8775c36bcb2ceef9ca1a00c7765f1d2735 (patch)
treecbbf47758983c276e0310b7f1f7be80524a2d660 /src/gui/graphicsview/qgraphicsscene.cpp
parenteda77b7c410a59d1b77c263994679452613d9d0b (diff)
downloadQt-b4456f8775c36bcb2ceef9ca1a00c7765f1d2735.zip
Qt-b4456f8775c36bcb2ceef9ca1a00c7765f1d2735.tar.gz
Qt-b4456f8775c36bcb2ceef9ca1a00c7765f1d2735.tar.bz2
Fixes: Get rid of a gazillion calls to QTransform::operator*=.
Details: Be a little bit smarter before doing *= :)
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 9b06945..b509507 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4772,8 +4772,9 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
if (itemCache->allExposed || !itemCache->exposed.isEmpty() || !scrollExposure.isEmpty()) {
// Construct an item-to-pixmap transform.
QPointF p = deviceRect.topLeft();
- QTransform itemToPixmap = QTransform::fromTranslate(-p.x(), -p.y());
- itemToPixmap = painter->worldTransform() * itemToPixmap;
+ QTransform itemToPixmap = painter->worldTransform();
+ if (!p.isNull())
+ itemToPixmap *= QTransform::fromTranslate(-p.x(), -p.y());
// Map the item's logical expose to pixmap coordinates.
QRegion pixmapExposed = scrollExposure;