guoyingtao / Mantis

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

counterclockwiseRotate do not triggers CropViewControllerDelegate methods #219

Closed mikestalker closed 2 years ago

mikestalker commented 2 years ago

No any method from CropViewControllerDelegate called when used any build in transformation: .counterclockwiseRotate, .clockwiseRotate, .alterCropper90Degree, .verticallyFlip, .horizontallyFlip. Only .reset and .ratio actions triggers cropViewControllerDidEndResize and cropViewControllerDidBeginResize.

Is there any chanse to get information regarding actions from standart CropToolbar without creating own CropToolbar class?

guoyingtao commented 2 years ago

Hi @mikestalker Can you give more details about the information you want from other actions?

mikestalker commented 2 years ago

Hello @guoyingtao I'm using your library in application for editing photo, and after some transformations are done - there appears "Apply" button in my app. And only after user press "apply" I perform cropViewController?.crop(). So I need some event in delegate that informs me that some transformations were done, before I make "Apply" button available. Currently I use cropViewControllerDidEndResize but it do not works for most events from CropToolbar.

mikestalker commented 2 years ago

@guoyingtao sorry for bothering you, but can you please give me hint about your thoughts regarding this? Thank you in advance

guoyingtao commented 2 years ago

Hi @mikestalker I can add more delegate functions to expose more editing events. Hope I can get a chance to do it this weekend.

guoyingtao commented 2 years ago

Hi @mikestalker I added a new function cropViewControllerDidImageTransformed in CropViewControllerDelegate in this PR #222 Can you take a look to see if it is what you want?

mikestalker commented 2 years ago

Hello @guoyingtao , looks like that's what I need. Thank you for such quick fix. Waiting for 2.1.3.

guoyingtao commented 2 years ago

Just released Mantis 2.2.0 which should solve this issue. Can you take a look? @mikestalker

mikestalker commented 2 years ago

Wow. Thank you so much @guoyingtao Just checked - works like a charm. As idea for future, maybe it can be useful if there is one more delegate method cropViewControllerDidImageReset - called when image reset to initial state. Not critical for me at all, just genereted idea. Thank you one more time.