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

handle polygon draw case where start point equals end point #682

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

fs-99
Copy link
Contributor

@fs-99 fs-99 commented Aug 12, 2024

Thank you for the nice library, I'm using it mostly for basic draw calls.
I stumbled upon this when drawing shapes with randomly generated points, where I don't really care if this backend adds the endpoint for the last line or if I randomly generated the same end point as the start point.

@fs-99
Copy link
Contributor Author

fs-99 commented Aug 12, 2024

I forgot to change the docs: should I just remove the point about open paths or should I say "This supports both open and closed paths, i.e. the first and last points can be the same but don't have to."

Copy link
Member

@ripytide ripytide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks useful, I would change the docs to say that it supports open and closed paths and that if the last point is not equal to the first then the path is closed anyway.

src/drawing/polygon.rs Show resolved Hide resolved
src/drawing/polygon.rs Show resolved Hide resolved
src/drawing/polygon.rs Outdated Show resolved Hide resolved
@theotherphil
Copy link
Contributor

Seems like reasonable behaviour if clearly documented. Thanks, I’ll merge after the docs are updated to explain the new behaviour.

@fs-99
Copy link
Contributor Author

fs-99 commented Aug 20, 2024

Done. (and @ripytide I gave it the names, the length is already checked if that was your point)

@theotherphil
Copy link
Contributor

Thanks!

@theotherphil theotherphil merged commit c153f57 into image-rs:master Aug 20, 2024
15 checks passed
@fs-99 fs-99 deleted the patch-1 branch August 21, 2024 01:04
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

Successfully merging this pull request may close these issues.

3 participants