Skip to content

Add ability to adjust aspect ratio of rectangle crop#49

Merged
benedom merged 4 commits into
benedom:masterfrom
AndrewHanshaw:adjust-aspect-ratio
Apr 21, 2026
Merged

Add ability to adjust aspect ratio of rectangle crop#49
benedom merged 4 commits into
benedom:masterfrom
AndrewHanshaw:adjust-aspect-ratio

Conversation

@AndrewHanshaw

@AndrewHanshaw AndrewHanshaw commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Added the ability to adjust the crop aspect ratio on rectangle masks using grab handles. The adjustment is symmetrical (i.e. dragging the top handle also moves the bottom handle, likewise with the left/right handles).

The feature is able to be enabled with a new allowAspectRatioResizing parameter in SwiftyCropConfiguration, and the min/max aspect ratios can be set with minAspectRatio and maxAspectRatio, respectively

Added a color option for the grab handles and outline

Video of the feature in action:

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-18.at.11.11.37.mov

Comment thread Sources/SwiftyCrop/Models/CropViewModel.swift
Comment thread Sources/SwiftyCrop/Models/CropViewModel.swift
Comment thread Sources/SwiftyCrop/View/CropView.swift
Comment thread Sources/SwiftyCrop/View/CropView.swift Outdated
Comment thread Sources/SwiftyCrop/View/CropView.swift Outdated
@benedom

benedom commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Thanks for adding this nice functionality! I have some review comments about your changes :)

@benedom benedom merged commit 0374ffb into benedom:master Apr 21, 2026
1 check passed
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