[Windows] Fixed Shadow not updated when Clipping a View with a shadow#27873
Merged
PureWeen merged 7 commits intodotnet:inflight/currentfrom Mar 18, 2025
Merged
[Windows] Fixed Shadow not updated when Clipping a View with a shadow#27873PureWeen merged 7 commits intodotnet:inflight/currentfrom
PureWeen merged 7 commits intodotnet:inflight/currentfrom
Conversation
jsuarezruiz
suggested changes
Feb 18, 2025
Contributor
jsuarezruiz
left a comment
There was a problem hiding this comment.
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))); |
Contributor
There was a problem hiding this comment.
This works if the View already have a Shadow, but, works if the order is:
- Clip
- Add a Shadow
?
Contributor
Author
There was a problem hiding this comment.
@jsuarezruiz , A new shadow will be created if the order is reversed.
Contributor
Author
@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. |
Contributor
|
/rebase |
01bc110 to
1c3a753
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
1c3a753 to
aa1230b
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
approved these changes
Mar 7, 2025
PureWeen
pushed a commit
that referenced
this pull request
Mar 26, 2025
…#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
PureWeen
pushed a commit
that referenced
this pull request
Mar 26, 2025
…#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
github-actions bot
pushed a commit
that referenced
this pull request
Mar 27, 2025
…#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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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