Skip to content

Allow user to change ruler direction and orientation #192

Closed
9 of 9 issues completed
Closed

Description

@pascalpp

Summary

Add user-facing Flip Horizontal and Flip Vertical actions for changing the shared ruler zero corner. Internally, the feature should model four zero-corner states: top-left, top-right, bottom-left, and bottom-right.

Flip Horizontal toggles the zero corner left/right. Flip Vertical toggles the zero corner top/bottom. Performing both moves from one diagonal corner to the other.

Product Model

  • User-facing language should stay action-oriented: Flip Horizontal and Flip Vertical.
  • Internal logic may use a shared zero-corner model.
  • The key invariant is that the two rulers should always be drawable and positionable so their zero edges can meet at the selected zero corner.
  • Flipping one axis can also change the other ruler’s tick/label side so the rulers can still form a coherent measuring corner.

Behavior

  • Default state preserves current behavior: horizontal zero at left, vertical zero at top.
  • Flip Horizontal toggles left/right zero-corner placement.
  • Flip Vertical toggles top/bottom zero-corner placement.
  • Ungrouped rulers: flipping redraws both rulers and updates tick/label sides, but does not move the non-flipped ruler.
  • Grouped rulers: flipping moves the non-flipped ruler so its zero point keeps the same zero-point offset relationship it had before the flip.
  • Resize handles stay at the far end of each ruler’s measurement direction.
  • Align Rulers at Mouse Location aligns the active shared zero corner to the mouse.
  • Reset Ruler Positions preserves the current zero-corner state and places rulers in a coherent default arrangement for that corner.

UI

  • Add menu actions:
    • Flip Horizontal
    • Flip Vertical
  • Add focused-ruler hotkeys:
    • Shift+H: Flip Horizontal
    • Shift+V: Flip Vertical
  • Add hotkey bezel feedback.
  • Localize new menu, bezel, and help strings.

Child Issues

Child issues should be created and linked after this parent exists. Suggested breakdown:

  • Persist zero-corner state
  • Introduce zero-corner geometry helpers
  • Draw rulers for all zero-corner states
  • Make resize direction-aware
  • Handle grouped and ungrouped flip behavior
  • Add menu actions, hotkeys, and localization
  • Integration QA

Acceptance Criteria

  • All four zero-corner states work visually and behaviorally.
  • Grouped and ungrouped flip behavior matches the model above.
  • Ruler drawing, mouse labels, resize handles, align-at-mouse, reset positions, relaunch persistence, and hidden ruler behavior are verified.
  • Core unit tests pass with xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerTests.

Sub-issues

Sub-issues

9 of 9 Issues completed
Loading 9 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions