Fixed connecting discontiguous corners #8620
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.