Skip to content

Commit

Permalink
Call QQuickItemPrivate::transformChanged when the clip is dirtied
Browse files Browse the repository at this point in the history
An item that observes the viewport may use this to do clipping via
QQuickItem::clipRect(), in which case changing the clip of a parent
item needs to be reflected by a transformChanged call for the observing
item.

Change-Id: I02df01a6ff6d48695bcf55a65983966c0575d86b
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
torarnv committed Dec 8, 2023
1 parent b00798d commit cfb28a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quick/items/qquickitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5377,7 +5377,7 @@ bool QQuickItemPrivate::transformChanged(QQuickItem *transformedItem)
}
// If ItemObservesViewport, clipRect() calculates the intersection with the viewport;
// so each time the item moves in the viewport, its clipnode needs to be updated.
if (thisWantsIt && q->clip())
if (thisWantsIt && q->clip() && !(dirtyAttributes & QQuickItemPrivate::Clip))
dirty(QQuickItemPrivate::Clip);
return ret;
}
Expand Down Expand Up @@ -6629,7 +6629,7 @@ void QQuickItemPrivate::dirty(DirtyType type)
QQuickWindowPrivate::get(window)->dirtyItem(q);
}
}
if (type & (TransformOrigin | Transform | BasicTransform | Position | Size))
if (type & (TransformOrigin | Transform | BasicTransform | Position | Size | Clip))
transformChanged(q);
}

Expand Down

0 comments on commit cfb28a9

Please sign in to comment.