-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed polygon stroke not rendering when fillrule is NonZero #31787
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
Fixed polygon stroke not rendering when fillrule is NonZero #31787
Conversation
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
left a comment
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.
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.
Pull Request Overview
This PR fixes a rendering issue where polygon strokes were only visible on external edges when using the NonZero fill rule, rather than being drawn on both external and internal parts as expected.
- Modified the drawing order in
ShapeDrawable.csto draw fill first, then stroke on top - Added comprehensive test coverage with both a sample page demonstrating the issue and a UI test for validation
Reviewed Changes
Copilot reviewed 3 out of 21 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Core/src/Graphics/ShapeDrawable.cs | Changed drawing order to render fill before stroke, ensuring stroke visibility on all edges |
| src/Controls/tests/TestCases.HostApp/Issues/Issue19095.cs | Added sample page with polygon demonstrating NonZero fill rule and stroke rendering |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19095.cs | Added UI test to verify the fix works correctly with screenshot validation |
|
@jsuarezruiz added pending snaps |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* Fixed polygon non zero fill issue * Added pending snaps
* Fixed polygon non zero fill issue * Added pending snaps


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!
Description of Change
This pull request addresses an issue where the stroke of a shape (specifically a polygon) was only being drawn on the external part, not on both the external and internal parts as expected when using the
Nonzerofill rule. The main changes include updating the drawing order in the rendering logic and adding both a sample test case and a UI test to verify the fix.Rendering logic fix:
ShapeDrawable.DrawinShapeDrawable.csto draw the fill first and then the stroke, ensuring the stroke is fully visible on both external and internal edges of shapes.Test coverage:
Issue19095inTestCases.HostAppthat demonstrates a polygon with theNonzerofill rule and verifies the stroke is drawn correctly on all edges.Issue19095inTestCases.Shared.Teststhat verifies the description label appears and takes a screenshot for visual validation.Issues Fixed
Fixes #19095
Output