summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-17 10:42:07 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-04-15 10:18:18 (GMT)
commit4c5e1ebe44f2d5f10a1798af45f5f7a18c6e9e82 (patch)
treeac3c8115c8c52c7c3971d389947e346208f1b6dc
parentac256e5eac02ec44557b6e90ad183a51c772bf33 (diff)
downloadQt-4c5e1ebe44f2d5f10a1798af45f5f7a18c6e9e82.zip
Qt-4c5e1ebe44f2d5f10a1798af45f5f7a18c6e9e82.tar.gz
Qt-4c5e1ebe44f2d5f10a1798af45f5f7a18c6e9e82.tar.bz2
Fixes: Only use the parent's cached clip path if it is clipped.
RevBy: TrustMe Details: ...otherwise it'll be empty and too much will be clipped away. (cherry picked from commit 4d019e66fb62d6f25627144539abd7f59413abee)
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 64bca7e..3a67f6e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3157,11 +3157,12 @@ QPainterPath QGraphicsItem::clipPath() const
const QGraphicsItem *lastParent = this;
// Intersect any in-between clips starting at the top and moving downwards.
+ bool foundValidClipPath = false;
while ((parent = parent->d_ptr->parent)) {
if (parent->d_ptr->flags & ItemClipsChildrenToShape) {
// Map clip to the current parent and intersect with its shape/clipPath
clip = lastParent->itemTransform(parent).map(clip);
- if (!parent->d_ptr->dirtyClipPath) {
+ if ((foundValidClipPath = !parent->d_ptr->dirtyClipPath && parent->isClipped())) {
clip = clip.intersected(parent->d_ptr->cachedClipPath);
if (!(parent->d_ptr->flags & ItemClipsToShape))
clip = clip.intersected(parent->shape());
@@ -3177,7 +3178,7 @@ QPainterPath QGraphicsItem::clipPath() const
}
if (!(parent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
- || !parent->d_ptr->dirtyClipPath) {
+ || foundValidClipPath) {
break;
}
}