Repository navigation
Fix truncation of degree-one vertex labels - #108
Merged
john-boyer-phd merged 1 commit intoSep 22, 2026
Merged
john-boyer-phd merged 1 commit into
john-boyer-phd merged 1 commit into
Conversation
john-boyer-phd
approved these changes
Sep 22, 2026
john-boyer-phd
left a comment
Member
There was a problem hiding this comment.
The difference between the right line of code and the almost right line of code can be like the difference between lightning and the lightning bug.
Good work, thank you!
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.
Resolves #105.
Type of change
A degree-one vertex has identical start and end coordinates, but its rounded rectangle still has padding. The truncation check used the zero-width interval and replaced even a single digit with
.... Measure the actual rectangle bounds, including padding, so labels that fit are retained. This leaves the vertex geometry and truncation algorithm unchanged.Changes
Added
tests/test_draw_labels.py: path and single-edge regressions through both draw entry points at the default and reported figure sizes, plus long-label truncation coverage.Updated
planarity/express/planarity.pyx: use the rounded rectangle's bounds for label width.Testing
.venv/bin/python -m pip install ..venv/bin/pytest -vv— 58 passed; the 10 new cases failed before the fix..venv/bin/python -m build --outdir /tmp/creator-planarity-dist— sdist and wheel built.PATH="$PWD/.venv/bin:$PATH" .venv/bin/cython-lint planarity/express/planarity.pyxreports the same 10 pre-existing style violations before and after this change. Verified locally on macOS with Python 3.14.6; the other CI platforms/Python versions were not run locally.