Skip to content

Add custom resize handle cursors#184

Merged
pascalpp merged 4 commits into
codex/173-resize-handlefrom
codex/183-custom-resize-cursors
Jun 11, 2026
Merged

Add custom resize handle cursors#184
pascalpp merged 4 commits into
codex/173-resize-handlefrom
codex/183-custom-resize-cursors

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Refs #183

Summary

  • replace the resize-handle cursor helper with generated custom NSCursor images for horizontal and vertical resizing
  • draw the cursors with black strokes and a white outline to approximate macOS window resize cursors without private AppKit selectors
  • add a focused unit test covering the custom cursor image size, centered hotspot, and non-template rendering

Tests

  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test (RulerCoreTests passed; UI tests failed while another agent was also running tests, causing app/window interaction contention)

@pascalpp pascalpp force-pushed the codex/183-custom-resize-cursors branch 3 times, most recently from e401d37 to bab8c66 Compare June 11, 2026 06:22
@pascalpp pascalpp force-pushed the codex/183-custom-resize-cursors branch from bab8c66 to 0ea5667 Compare June 11, 2026 06:24
pascalpp added 2 commits June 11, 2026 02:47
Refine the resize-handle cursor appearance and preview UI: reduce arrow/shaft sizes and stroke, add miterLimit and shadow parameters (alpha, blur, offset, padding) and draw the cursor with an NSShadow for depth. Adjust image/hotSpot APIs to account for orientation when computing size, and update cursor drawing to honor the new parameters and miter limit. Revise the debug preview defaults, layout, sliders (more granular steps and additional controls for shadow/miter), and preview sizing to better match the new visuals and allow interactive tuning.
@pascalpp pascalpp changed the title [codex] Add custom resize handle cursors Add custom resize handle cursors Jun 11, 2026
@pascalpp pascalpp marked this pull request as ready for review June 11, 2026 06:53
@pascalpp pascalpp requested a review from Copilot June 11, 2026 06:53

Copilot AI 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 implements custom AppKit resize cursors for the ruler resize handles by generating NSCursor images at runtime, aiming to approximate the private macOS window resize cursors while remaining App Store-safe.

Changes:

  • Replaces use of .resizeLeftRight / .resizeUpDown with generated custom NSCursor images for horizontal/vertical resizing.
  • Adds cursor image generation logic (outline + shadow) and a DEBUG SwiftUI preview for tuning.
  • Adds a unit test validating cursor image sizes, centered hotspot, and non-template rendering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
FreeRulerTests/RulerCoreTests.swift Adds a focused unit test validating the generated resize cursor image properties.
Free Ruler/ResizeHandleView.swift Introduces generated custom cursor images (plus DEBUG preview tooling) and wires them into resize-handle cursor behavior.

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

Comment thread Free Ruler/ResizeHandleView.swift
@pascalpp pascalpp merged commit 0fdd346 into codex/173-resize-handle Jun 11, 2026
@pascalpp pascalpp deleted the codex/183-custom-resize-cursors branch June 11, 2026 13:00
Sign up for free to 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