summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-17 10:42:07 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:43 (GMT)
commit4d019e66fb62d6f25627144539abd7f59413abee (patch)
tree365008e55182d4db3150013a09a3c12723660134 /src/gui
parent4020327503eaefae42da4bd6e71125b6972ac97f (diff)
downloadQt-4d019e66fb62d6f25627144539abd7f59413abee.zip
Qt-4d019e66fb62d6f25627144539abd7f59413abee.tar.gz
Qt-4d019e66fb62d6f25627144539abd7f59413abee.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.
Diffstat (limited to 'src/gui')
-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 5b997f4..a3a12e7 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;
}
}