-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fixed Shadow not updated when Clipping a View with a shadow #27873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Fixed Shadow not updated when Clipping a View with a shadow #27873
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the sample tests the two possible scenarios:
- Have a View with a Shadow and then clip it.
- Have a View without a Shadow, clip it and then add the shadow.
In both cases, the shadow must adapt to the clipped path.
|
|
||
| visual.Clip = geometricClip; | ||
| //When the clip is updated, the shadow must be updated as well | ||
| UpdateShadowAsync().FireAndForget(IPlatformApplication.Current?.Services?.CreateLogger(nameof(WrapperView))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works if the View already have a Shadow, but, works if the order is:
- Clip
- Add a Shadow
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz , A new shadow will be created if the order is reversed.
@jsuarezruiz , i have updated the test case to ensure the above mentioned scenarios. I have updated the before and after video reference in the PR template. Please let me know if you have any concerns. |
|
/rebase |
01bc110 to
1c3a753
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
1c3a753 to
aa1230b
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…#27873) * Fixed Shadow not updated when Clipping a View with a shadow * FIxed shadow not updating with vlip * Updated code changes * Updated testcase image * Updated test case * updated test case image * Added pending snapshots
…#27873) * Fixed Shadow not updated when Clipping a View with a shadow * FIxed shadow not updating with vlip * Updated code changes * Updated testcase image * Updated test case * updated test case image * Added pending snapshots
…#27873) * Fixed Shadow not updated when Clipping a View with a shadow * FIxed shadow not updating with vlip * Updated code changes * Updated testcase image * Updated test case * updated test case image * Added pending snapshots
Issue Details:
When applying clipping at runtime, the shadow effect fails to render properly for the view. The shadow property, which should adjust based on the clipping bounds, remains unchanged leading to incorrect shadow rendering.
Root Cause:
The clipping update operation does not trigger a notification to the shadow property that depends on it. This missing dependency notification results in the shadow not being recalculated and updated when the clip bounds change.
Description of Change:
Added a call to
UpdateShadowAsync()method after clip updates to ensure the shadow property is properly recalculated. This ensures that when clipping bounds are modified at runtime, the shadow effect is updated accordingly to maintain visual consistency.Validated the behaviour in the following platforms
Issues Fixed
Fixes #27730
Output
Before.2.mp4
After.1.mp4