Skip to content

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

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 Nonzero fill 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:

  • Modified ShapeDrawable.Draw in ShapeDrawable.cs to draw the fill first and then the stroke, ensuring the stroke is fully visible on both external and internal edges of shapes.

Test coverage:

  • Added a new sample page Issue19095 in TestCases.HostApp that demonstrates a polygon with the Nonzero fill rule and verifies the stroke is drawn correctly on all edges.
  • Added a UI test for Issue19095 in TestCases.Shared.Tests that verifies the description label appears and takes a screenshot for visual validation.

Issues Fixed

Fixes #19095

Output

Before After
Before After

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Sep 26, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz jsuarezruiz added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Sep 29, 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.

Failing tests on Windows:
image

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review September 30, 2025 11:21
Copilot AI review requested due to automatic review settings September 30, 2025 11:21
Copy link
Contributor

Copilot AI left a 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.cs to 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

@NirmalKumarYuvaraj
Copy link
Contributor Author

Failing tests on Windows: image

@jsuarezruiz added pending snaps

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current October 9, 2025 21:51
@PureWeen PureWeen merged commit 3a270af into dotnet:inflight/current Oct 9, 2025
70 of 78 checks passed
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
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shape's stroke is drawing only the external part, the inner part (within the shape area) is not drawing

3 participants