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:
parent
39d7ac71c2
commit
1ad823377a
1 changed files with 4 additions and 2 deletions
|
@ -492,8 +492,10 @@ static void adjustClipRegion(AbstractThumbnailItem *item, QRegion &clippingRegio
|
||||||
offset.setY(anchorsObject->property("topMargin").toReal());
|
offset.setY(anchorsObject->property("topMargin").toReal());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const QRectF rect = parentItem->mapRectToScene(QRectF(parentItem->position() - offset,
|
QRectF rect = QRectF(parentItem->position() - offset, QSizeF(parentItem->width(), parentItem->height()));
|
||||||
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();
|
clippingRegion &= rect.adjusted(0,0,-1,-1).translated(item->window()->position()).toRect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue