Skip to content

Commit

Permalink
Fix that the reparented items outside mask clip rect still could be t…
Browse files Browse the repository at this point in the history
…ouched. (#18039)
  • Loading branch information
dumganhar authored Dec 17, 2024
1 parent dcdbc64 commit 7340ce2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cocos/scene-graph/node-event-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,11 @@ export class NodeEventProcessor {
}

public reattach (): void {
let currentMaskList: IMask[] | null;
this.node.walk((node) => {
if (!currentMaskList) {
currentMaskList = this._searchComponentsInParent(NodeEventProcessor._maskComp);
}
node.eventProcessor.maskList = currentMaskList;
const eventProcessor = node.eventProcessor;
// NOTE: When reattaching the current node, the masks of all its descendants need to be recalculated
const currentMaskList = eventProcessor._searchComponentsInParent(NodeEventProcessor._maskComp);
eventProcessor.maskList = currentMaskList;
});
}

Expand Down

0 comments on commit 7340ce2

Please sign in to comment.