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 connecting discontiguous corners #8620

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

Resolves #8616

#5980 introduced code to connect discontiguous corners, when the angles in a polygon became acute enough that drawing each line going across the image in isolation left gaps. It did so by moving one of the points along the x-axis to draw more pixels and connect the parts.

Then #6303 tried to fix a bug where instead of drawing more pixels by moving a line end, a starting point was moved, and less pixels were drawn. It did so by ensuring that the the vertex being fixed was the top of both lines, or the bottom of both lines. However, the bug has now resurfaced in #8616, so this PR removes that first fix. Instead, this PR checks that it is an odd numbered x-coordinate that is checked for a discontiguous corner - odd meaning the end of a horizontal set of pixels, rather than the start.

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.

ImageDraw.polygon produces the wrong image
1 participant