Skip to content

Introduce zero corner geometry helpers - #201

Closed
pascalpp wants to merge 1 commit into
pascal/192-flip-rulersfrom
pascal/193-zero-corner-helpers
Closed

Introduce zero corner geometry helpers#201
pascalpp wants to merge 1 commit into
pascal/192-flip-rulersfrom
pascal/193-zero-corner-helpers

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Summary

  • Add ZeroCornerGeometry as the shared helper layer for zero-corner traits and frame placement.
  • Route align/reset placement and resize-handle math through the zero-corner model.
  • Cover all four zero-corner states with focused core tests.

Validation

  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerTests

Closes#193.

@pascalpp
pascalpp changed the base branch from codex/192-persist-zero-corner to pascal/192-flip-rulersJune 13, 2026 05:30
@pascalpp
pascalppforce-pushed the pascal/193-zero-corner-helpers branch from a55a133 to d176e65CompareJune 13, 2026 05:38
@pascalppGraphite App

pascalpp commented Jun 13, 2026

Copy link
Copy Markdown
OwnerAuthor

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pascalpppascalpp mentioned this pull request Jun 13, 2026
@pascalpppascalpp changed the title [codex] Introduce zero corner geometry helpersIntroduce zero corner geometry helpersJun 13, 2026
@pascalpp
pascalpp marked this pull request as ready for review June 13, 2026 05:43
@pascalpp
pascalpp requested a review from CopilotJune 13, 2026 05:45

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a centralized ZeroCornerGeometry helper to consistently derive zero-corner-dependent behavior (frame placement, growth direction, tick side, and resize-handle side) across ruler operations, and adds targeted unit tests to validate all four zero-corner states.

Changes:

  • Add ZeroCornerGeometry (plus supporting RulerGrowthDirection/RulerSide) to model zero-corner traits and compute zero-point/frame placement.
  • Route ruler alignment/reset positioning through ZeroCornerGeometry-backed frame placement.
  • Update resize-handle placement and resize-frame math to respect the selected zero corner, with new unit tests covering additional resize directions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

FileDescription
FreeRulerTests/RulerCoreTests.swiftAdds focused tests covering all four zero-corner states and new resize directions.
Free Ruler/RulerController.swiftUses ZeroCornerGeometry for alignment and zero-corner-aware default positioning on reset.
Free Ruler/Ruler.swiftIntroduces ZeroCornerGeometry and refactors default frame computation to use the helper.
Free Ruler/ResizeHandleView.swiftMakes resize-handle placement and resizing math depend on the zero-corner-derived resize side.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pascalpp