scene/workspacescene: also check for occlusion of the parent item

Somehow this was dropped in a rebase of def0bde5e9
This commit is contained in:
Xaver Hugl 2024-08-20 13:40:09 +02:00
parent aa88904b53
commit 874189f11b

View file

@ -169,6 +169,9 @@ static bool addCandidates(SurfaceItem *item, QList<SurfaceItem *> &candidates, s
if (candidates.size() >= maxCount || item->hasEffects()) { if (candidates.size() >= maxCount || item->hasEffects()) {
return false; return false;
} }
if (occluded.contains(item->mapToScene(item->boundingRect()).toAlignedRect())) {
return true;
}
candidates.push_back(item); candidates.push_back(item);
occluded += item->mapToScene(item->opaque()); occluded += item->mapToScene(item->opaque());
for (; it != children.rend(); it++) { for (; it != children.rend(); it++) {