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

Add support for polygons with holes #222

Open
tibotiber opened this issue Jun 25, 2024 · 2 comments
Open

Add support for polygons with holes #222

tibotiber opened this issue Jun 25, 2024 · 2 comments

Comments

@tibotiber
Copy link
Contributor

Hey @williamngan, I was wondering if there was any interest to support polygons with holes in the API? I see that the canvas API supports it (stackoverflow).

@williamngan
Copy link
Owner

Oh right, that would be a good feature. Maybe the API can be something like form.fillRule('evenodd').fill("#f00") ?

My bandwidth is very limited until probably mid Aug. Please send a PR if you would like to add this feature. Thanks so much!

@tibotiber
Copy link
Contributor Author

I think the fill itself will be automatic, it's more about building the path. We'll need something like a polygonWithHoles(ptRings: PtLikeIterable[]) where the first ring is the outer one and then the others are the holes. Or maybe polygonWithHoles(pts: PtLikeIterable, holes: PtLikeIterable[]). What do you think? Any preferred naming/vocabulary?

I'm also swamped for now, but I've got a card opened for this in our backlog ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants