refactor(drawing): unify circle-visibility test between addAutoDimensions and addAutoCentermarks (#1181) - #1201
Merged
Merged
Conversation
…ions and addAutoCentermarks (#1181)
…ines.swift - Fix swift-format lint error for BeginDocumentationCommentWithOneLineSummary Signed-off-by: elb <elb@users.noreply.github.com> Co-authored-by: Kilo <noreply@kilo.ai>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review SummaryCurrent summary above is authoritative. Previous snapshots are kept for context only. Previous reviewStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 95K · Output: 5.1K · Cached: 77.8K |
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.
What & why
Unified the circle-visibility test (edge-on cutoff + bounds clip) shared by
addAutoDimensionsandaddAutoCentermarks. Previously both functions had verbatim-duplicated loops with the same geometry test (magic0.1threshold,simd_cross/simd_dotedge-on check, bounds clip) but diverged in skip recording:addAutoDimensionsrecorded all four skip reasons as strings, whileaddAutoCentermarksonly recorded edge-on skips asEdgeobjects. Now both use a sharedtestCircleVisibilityhelper with anonSkipclosure, allowing each caller to record skips in its own format while the geometry test is single-source.Closes #1181
CHANGELOG entry
refactor(drawing): unify circle-visibility test between addAutoDimensions and addAutoCentermarks (#1181)
SemVer impact
NONE. Pure refactor with no public API surface change — both functions keep their exact signatures and return types; only the internal implementation is deduplicated. Existing tests pass without modification.
Checklist
--self-testcase was run once with its subject broken, and the failure is reported heredocs/CHANGELOG.mdis not in this diff.docs/SEMVER.mdis not in this diff.Notes for the reviewer
This is part of the Pass 4b duplication audit (#386). The shared helper is
internalinDrawingAutoCenterlines.swiftand used by bothDrawingAutoDimensions.swiftandDrawingAutoCenterlines.swift. TheonSkipclosure allowsaddAutoDimensionsto record all skip reasons as strings whileaddAutoCentermarksonly records edge-on skips asEdgeobjects (preserving its existingskipped: [Edge]return type).