Skip to content
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

[BUG] Holes in Polygons do not always appear #1924

Closed
JaffaKetchup opened this issue Jun 27, 2024 · 0 comments · Fixed by #1925
Closed

[BUG] Holes in Polygons do not always appear #1924

JaffaKetchup opened this issue Jun 27, 2024 · 0 comments · Fixed by #1925
Assignees
Labels
bug This issue reports broken functionality or another error P: 1 (important) S: core Scoped to the core flutter_map functionality

Comments

@JaffaKetchup
Copy link
Member

JaffaKetchup commented Jun 27, 2024

What is the bug?

The points of holes in Polygons must be specified in a winding direction opposite to the winding direction used to specify the normal points - otherwise, a hole is not cut.

The bug was introduced in #1901.

How can we reproduce it?

Reverse the order of the inner hole points in the example application.

image

Do you have a potential solution?

Using proper Path.combine techniques in the painter appears to fix the issue:

filledPath = Path.combine(
	PathOperation.xor,
	filledPath,
	Path()..addPolygon(holeOffsets, true),
);

However, this is not supported on the Web HTML backend: flutter/flutter#44572.

Instead, the following line works, but was inadvertantely removed and the introduced bug was not found in testing:

filledPath.fillType = PathFillType.evenOdd;

Platforms

All

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

@JaffaKetchup JaffaKetchup added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing P: 1 (important) S: core Scoped to the core flutter_map functionality and removed needs triage This new bug report needs reproducing and prioritizing labels Jun 27, 2024
@JaffaKetchup JaffaKetchup self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error P: 1 (important) S: core Scoped to the core flutter_map functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant