Fix clipping of ThumbnailItem to parent item

The clip region was incorrectly calculated as the mapToScene was applied
to the wrong item.

BUG: 335246
This commit is contained in:
Martin Gräßlin 2014-05-23 20:39:21 +02:00
parent 39d7ac71c2
commit 1ad823377a

View file

@ -492,8 +492,10 @@ static void adjustClipRegion(AbstractThumbnailItem *item, QRegion &clippingRegio
offset.setY(anchorsObject->property("topMargin").toReal());
}
}
const QRectF rect = parentItem->mapRectToScene(QRectF(parentItem->position() - offset,
QSizeF(parentItem->width(), parentItem->height())));
QRectF rect = QRectF(parentItem->position() - offset, QSizeF(parentItem->width(), parentItem->height()));
if (QQuickItem *p = parentItem->parentItem()) {
rect = p->mapRectToScene(rect);
}
clippingRegion &= rect.adjusted(0,0,-1,-1).translated(item->window()->position()).toRect();
}
}