guoyingtao / Mantis

An iOS Image cropping library, which mimics the Photo App written in Swift.
MIT License
900 stars 180 forks source link

Rotation break aspect ratio #289

Closed lionel-alves closed 1 year ago

lionel-alves commented 1 year ago

Hi,

The rotation button breaks the aspectRatio as it is rotated as well (not expected behaviour.

var config = Mantis.Config()
config.presetFixedRatioType = .alwaysUsingOnePresetFixedRatio(ratio: 2.0 / 3.0)
let cropViewController = Mantis.cropViewController(image: viewModel.originalImage, config: config)
cropViewController.delegate = context.coordinator

Before the rotation the aspect ratio is good:

image

After the rotation it is 3/2 instead of 2/3:

image

Thanks

guoyingtao commented 1 year ago

@lionel-alves alwaysUsingOnePresetFixedRatio is designed like that currently. If you want to locked the ratio while rotating, I need to add that support in the future versions.

TaLinh commented 1 year ago

Can you please expose CropView so we can do more customization with it? Mantis is an amazing library but right now it feels quite limiting in term of customization

guoyingtao commented 1 year ago

@TaLinh Can you give some examples about your customization? Exposing too much may make the library less flexible for future update.

guoyingtao commented 1 year ago

@TaLinh I closed this issue since it hasn't been answered for more than one month. You can reopen it anytime when you can provide some examples of your customization.