forked from qt-creator/qt-creator
QmlDesigner: Support transparent border for effects
If an effect uses transparent border int paints outside of the item. Without this patch the item is only rendered inside the bounds of the item. This patch always adds 40px to the bounding rectangle if an effect is detected. This is done by effectAdjustedBoundingRect(). The 40px should be sufficient for every realistic case. Task-number: QDS-3576 Change-Id: I82af0ea66c79039dcae92a88a5954b49de6d944f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -329,11 +329,23 @@ QRectF QuickItemNodeInstance::contentItemBoundingBox() const
|
||||
return QRectF();
|
||||
}
|
||||
|
||||
static bool layerEnabledAndEffect(QQuickItem *item)
|
||||
{
|
||||
QQuickItemPrivate *pItem = QQuickItemPrivate::get(item);
|
||||
|
||||
if (pItem && pItem->layer() && pItem->layer()->enabled() && pItem->layer()->effect())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QRectF QuickItemNodeInstance::boundingRect() const
|
||||
{
|
||||
if (quickItem()) {
|
||||
if (quickItem()->clip()) {
|
||||
return quickItem()->boundingRect();
|
||||
} else if (layerEnabledAndEffect(quickItem())) {
|
||||
return ServerNodeInstance::effectAdjustedBoundingRect(quickItem());
|
||||
} else {
|
||||
return boundingRectWithStepChilds(quickItem());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user