Fix that the reparented items outside mask clip rect still could be touched.#18039
Merged
Conversation
…ouched. When reattaching the current node, the masks of all its descendants need to be recalculated since IMask caches the index which means the distance to Mask node. Reported at https://forum.cocos.org/t/topic/163455/238?u=dumganhar There are two relevant PR requests: ## 1. cocos#8313 This PR could not fix the issue totally, there is a currMask cache which will be used for all current node's descendants, but descendants's IMask may have different 'index' value which indicates the distance to the Mask node. public reattach (): void { let currMask; this.node.walk((node) => { if (!currMask) { currMask = _searchComponentsInParent(node as Node, NodeEventProcessor._comp); } ...... }); } ## 2. cocos#9363 This PR made _searchComponentsInParent as instance method but in 'reattach', it will always invoke '_searchComponentsInParent' for the current node.
Contributor
Author
|
@cocos-robot run test cases |
👍 Package size ⤵ -10 bytes, old: 5442450, new: 5442440Interface Check ReportThis pull request does not change any public interfaces ! |
|
@dumganhar, Please check the result of
Task Details
|
|
@dumganhar, Please check the result of
Task Details
|
minggo
approved these changes
Dec 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When reattaching the current node, the masks of all its descendants need to be recalculated since IMask caches the index which means the distance to Mask node.
Reported at https://forum.cocos.org/t/topic/163455/238?u=dumganhar
There are two relevant PR requests:
1. #8313
This PR could not fix the issue totally, there is a currMask cache which will be used for all current node's descendants, but descendants's IMask may have different 'index' value which indicates the distance to the Mask node.
2. #9363
This PR made _searchComponentsInParent as instance method but in 'reattach', it will always invoke '_searchComponentsInParent' for the current node.
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: