Fixed polygon stroke not rendering when fillrule is NonZero#31787
Merged
PureWeen merged 2 commits intodotnet:inflight/currentfrom Oct 9, 2025
Merged
Fixed polygon stroke not rendering when fillrule is NonZero#31787PureWeen merged 2 commits intodotnet:inflight/currentfrom
PureWeen merged 2 commits intodotnet:inflight/currentfrom
Conversation
Contributor
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
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 |
Contributor
Author
|
@jsuarezruiz added pending snaps |
Contributor
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
approved these changes
Oct 1, 2025
PureWeen
pushed a commit
that referenced
this pull request
Oct 30, 2025
* Fixed polygon non zero fill issue * Added pending snaps
github-actions bot
pushed a commit
that referenced
this pull request
Nov 4, 2025
* Fixed polygon non zero fill issue * Added pending snaps
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.


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