diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-10-22 12:49:40 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-10-23 08:34:46 (GMT) |
commit | cc4d3fbc317bc9044c3ce23569f0225b29af4fd5 (patch) | |
tree | c76592219af2ddfc1d2a049d03ee98f8807a3639 /src/gui | |
parent | a95883e90fadeddd2f49da6765fb2d79f7ce77bd (diff) | |
download | Qt-cc4d3fbc317bc9044c3ce23569f0225b29af4fd5.zip Qt-cc4d3fbc317bc9044c3ce23569f0225b29af4fd5.tar.gz Qt-cc4d3fbc317bc9044c3ce23569f0225b29af4fd5.tar.bz2 |
QGraphicsLineItem leave traces when moving around (reg. against 4.5)
The problem was that QGraphicsLineItem's bounding rect is an empty rect
(either width is 0 or height is 0), and when updating the item's old
occupied area, we explicitly checked whether the rect was empty() or
not. In case of being empty (rect.isEmpty()) we did nothing, which was
the root of the problem.
We can safely remove the rect.isEmpty() check without any significant
loss of performance since the common case is that the rect is non-empty.
And in the case of being empty, we'll bail out from
QGraphicsViewPrivate::updateRect's highly optimized rect intersection.
Auto test included.
Task: QTBUG-4877
Reviewed-by: alexis
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 03c8a97..9736c3e 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4888,7 +4888,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool continue; } - if (item->d_ptr->paintedViewBoundingRectsNeedRepaint && !paintedViewBoundingRect.isEmpty()) { + if (item->d_ptr->paintedViewBoundingRectsNeedRepaint) { paintedViewBoundingRect.translate(viewPrivate->dirtyScrollOffset); if (!viewPrivate->updateRect(paintedViewBoundingRect)) paintedViewBoundingRect = QRect(-1, -1, -1, -1); // Outside viewport. |