cosmetic: remove redundant vertex workaround from gerbv_draw_polygon#436
Merged
spe-ciellt merged 1 commit intogerbv:developfrom Mar 17, 2026
Merged
Conversation
The loop in gerbv_draw_polygon ran i <= numberOfSidesInteger (inclusive) to repeat the first vertex as a zero-length closing segment. The comment explained this was needed because cairo might draw a spurious line from the polygon endpoint to the start of an aperture hole subpath. PR gerbv#380 fixed the root cause by adding cairo_new_sub_path() in gerbv_draw_aperture_hole(), which starts a fresh subpath before drawing any hole — severing the implicit connection entirely. With that fix in place the extra vertex is dead code. Remove it and the now-inaccurate comment. No functional change; golden images are unaffected. Closes gerbv#433.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #433.
What
gerbv_draw_polygonran its loop withi <= numberOfSidesInteger(inclusive), revisiting the first vertex as a zero-length closing segment. The comment said:Why it is now dead code
PR #380 added
cairo_new_sub_path()at the top ofgerbv_draw_aperture_hole(). That call starts a fresh subpath before any hole geometry is drawn, which severs the implicit Cairo connection from the polygon endpoint to the hole. The workaround is no longer needed.Change
i <= numberOfSidesInteger→i < numberOfSidesIntegerNo functional change. Golden test images are unaffected and do not need regeneration.