From 1ad823377a8f445f3ad4751a8c69eb43a41f4c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 23 May 2014 20:39:21 +0200 Subject: [PATCH] Fix clipping of ThumbnailItem to parent item The clip region was incorrectly calculated as the mapToScene was applied to the wrong item. BUG: 335246 --- scene.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene.cpp b/scene.cpp index 7ca6b894aa..c47b6e043c 100644 --- a/scene.cpp +++ b/scene.cpp @@ -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(); } }