Skip to content

feat(capture): fit translated text and add zoom and pan - #10

Open
cmalcantara wants to merge 1 commit into
PangMo5:mainfrom
cmalcantara:feat/capture-result-fit-zoom
Open

feat(capture): fit translated text and add zoom and pan#10
cmalcantara wants to merge 1 commit into
PangMo5:mainfrom
cmalcantara:feat/capture-result-fit-zoom

Conversation

@cmalcantara

Copy link
Copy Markdown

#Added fitted capture translations and native zoom/pan in capture popup

Warning: Modified with Codex

Summary

  • Added two optional Capture settings for complete translation fitting and native zoom/pan in
    region-capture results.
  • Fit complete horizontal and vertical translations inside their detected OCR boxes.
  • Prefer word-boundary wrapping while handling explicit newlines and long unbreakable text
    without clipping or ellipses.
  • Present capture results in a native NSScrollView with trackpad pinch zoom, two-finger
    diagonal panning, momentum, and natural scrolling.
  • Added toolbar and keyboard zoom controls using ⌘+, ⌘−, and ⌘0.
  • Preserve the viewport center when resizing the result window.
  • Improve small-font legibility on 1x displays using bounded additional backing detail while
    avoiding redundant oversampling on Retina displays.
  • Continue exporting the complete capture when saving or copying, rather than only the
    visible zoomed viewport.

Compatibility

  • Both new settings default to disabled.
  • Existing configuration files decode safely when the new settings are absent.
  • The existing capture rendering path remains unchanged when the options are disabled.
  • Live overlay behavior is unchanged.

Validation

  • Added 28 unit tests covering:
    • Settings backward compatibility and round trips
    • Horizontal and vertical text fitting
    • Multilingual text and explicit newlines
    • Long unbreakable text
    • Zoom geometry and magnification limits
    • Viewport preservation across resize
    • Small-capture magnification safety
    • Backing-detail memory limits
  • Confirmed trackpad pinch zoom, horizontal/vertical/diagonal two-finger panning, and
    momentum on macOS.
  • Confirmed complete translated text fitting and improved small-font legibility on a 1080p
    display.
  • Confirmed Save and Copy export the complete capture rather than the current viewport.

Test command

mise exec -- tuist xcodebuild test \
  -scheme SwiftyCrow \
  -workspace SwiftyCrow.xcworkspace \
  -destination 'platform=macOS' \
  -derivedDataPath DerivedData \
  CODE_SIGNING_ALLOWED=NO \
  CODE_SIGNING_REQUIRED=NO

Result: 28 tests passed with 0 failures.

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.

1 participant