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

Fixed drawing a 1px high polygon #4675

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Conversation

radarhere
Copy link
Member

Resolves #4674

When determining the ymin and ymax of a polygon, Pillow doesn't consider edges if they are horizontal. Sounds fair enough, because why would a horizontal line contribute to the height? Except, the definition of 'horizontal' here is that all of the points in the edge have the same y value, which in the case of a polygon that is 1px high, applies to all edges.

So this PR fixes that by allowing these 'horizontal' lines to expand the height of a polygon.

@hugovk hugovk merged commit b6d6f77 into python-pillow:master Jun 8, 2020
@hugovk
Copy link
Member

hugovk commented Jun 8, 2020

Thank you!

@radarhere radarhere deleted the polygon branch June 8, 2020 09:30
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.

Odd behaviour of ImageDraw.Draw.polygon
2 participants