-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fixed Image clipping not working #30684
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 Image clipping not working #30684
Conversation
|
Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
| VerticalOptions = LayoutOptions.Center | ||
| }; | ||
|
|
||
| var image = new Image |
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 you extend the sample using a Grid with different columns and clip with different geometries?
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 I have made the changes
| var pathGeometry = compositor.CreatePathGeometry(path); | ||
| var geometricClip = compositor.CreateGeometricClip(pathGeometry); | ||
|
|
||
| geometricClip.Offset = new Vector2(-Child.ActualOffset.X, -Child.ActualOffset.Y); |
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 include a comment explaining why apply these values here?
// Align clip geometry with the child's visual offset to prevent masking misalignment blablabla
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 I have added a comment.
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Updated Test Sample with different geometries Updated SnapShots
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
RootCause :
The clipping appears misaligned, causing the shape not accurately masks the image as expected.
Description of Change :
Updated the UpdateClip method to adjust the clip's offset using the Child.ActualOffset properties. This ensures that the clipping geometry aligns correctly with the child element's position.
Referrence :
maui/src/Core/src/Platform/Windows/ContentPanel.cs
Line 210 in 6137fa1
Issues Fixed :
Fixes #30440
Tested the behaviour in the following platforms :
Screenshot :