[glyphs] maintain start point when reversing closed path#1956
Merged
Conversation
b681ced to
5abe684
Compare
anthrotype
reviewed
Apr 15, 2026
| /// `reverse() + rotate_left(1)`, which keeps the start node at the last | ||
| /// position. We match that here. | ||
| /// | ||
| /// Note: this logic is only correct for closed paths. For open paths the |
Member
There was a problem hiding this comment.
so can't this logic only be applied for closed paths?
Member
Author
There was a problem hiding this comment.
see the note: do we want to fix this in glyphsLib? The codepath seems to only be exercised with closed paths at present, but it does seem like a bug.
I'll open an issue here and then can open a companion issue in glyphsLib.
Member
There was a problem hiding this comment.
yeah i think it's worth fixing in both. and if you say it's currently only exercised for closed paths, you can just do it now in fontc without affecting the crater results
Member
Author
There was a problem hiding this comment.
anthrotype
reviewed
Apr 15, 2026
This is a small detail on a very cold code path, but still is the cause of at least one crater diff. Concretely, when a smart component is flipped (via transform) we reverse the path; however our reversal logic was naive, and didn't keep the same start point.
5abe684 to
ab68707
Compare
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.
This is a small detail on a very cold code path, but still is the cause of at least one crater diff.
Concretely, when a smart component is flipped (via transform) we reverse the path; however our reversal logic was naive, and didn't keep the same start point.