diff options
author | aavit <qt-info@nokia.com> | 2010-05-05 08:28:16 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-05-05 08:28:16 (GMT) |
commit | 39c6ad12f97ca024ef4340edadb43c7f92327964 (patch) | |
tree | 3520ec3c8cfaf3a644bcee806792dfa89aaa060f /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | 87f7444d2af1299460bdbfc1cbfa903ea504b7e3 (diff) | |
parent | 44144cf60e978f7d5d70aec49d114d57832a78c3 (diff) | |
download | Qt-39c6ad12f97ca024ef4340edadb43c7f92327964.zip Qt-39c6ad12f97ca024ef4340edadb43c7f92327964.tar.gz Qt-39c6ad12f97ca024ef4340edadb43c7f92327964.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 326f130..81138d9 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -5635,8 +5635,9 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) // Adjust with 2 pixel margin. Notice the loss of precision // when converting to QRect. int adjust = 2; + QRectF scrollRect = !rect.isNull() ? rect : boundingRect(); QRectF br = boundingRect().adjusted(-adjust, -adjust, adjust, adjust); - QRect irect = rect.toRect().translated(-br.x(), -br.y()); + QRect irect = scrollRect.toRect().translated(-br.x(), -br.y()); pix.scroll(dx, dy, irect); @@ -5644,11 +5645,11 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) // Translate the existing expose. foreach (QRectF exposedRect, c->exposed) - c->exposed += exposedRect.translated(dx, dy) & rect; + c->exposed += exposedRect.translated(dx, dy) & scrollRect; // Calculate exposure. QRegion exposed; - QRect r = rect.toRect(); + QRect r = scrollRect.toRect(); exposed += r; exposed -= r.translated(dx, dy); foreach (QRect rect, exposed.rects()) |