image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

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

Closed fs-99 closed 3 months ago

fs-99 commented 3 months ago

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 commented 3 months ago

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."

theotherphil commented 3 months ago

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

fs-99 commented 3 months ago

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

theotherphil commented 3 months ago

Thanks!