Skip to content

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Feb 18, 2025

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

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #27730

Output

Before After
Before.2.mp4
After.1.mp4

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Feb 18, 2025
@jsuarezruiz jsuarezruiz added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Feb 18, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a 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:

  1. Have a View with a Shadow and then clip it.
  2. 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)));
Copy link
Contributor

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:

  1. Clip
  2. Add a Shadow
    ?

Copy link
Contributor Author

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.

@NirmalKumarYuvaraj
Copy link
Contributor Author

NirmalKumarYuvaraj commented Feb 19, 2025

Could the sample tests the two possible scenarios:

  1. Have a View with a Shadow and then clip it.
  2. Have a View without a Shadow, clip it and then add the shadow.

In both cases, the shadow must adapt to the clipped path.

@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.

@dotnet dotnet deleted a comment from azure-pipelines bot Feb 21, 2025
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current March 18, 2025 18:19
@PureWeen PureWeen merged commit 16d9890 into dotnet:inflight/current Mar 18, 2025
123 checks passed
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
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shadow not updated when Clipping a View with a shadow

4 participants