Tocropviewcontroller: Fixed aspect ration is not preserved after undo

Created on 2 May 2017  ·  1Comment  ·  Source: TimOliver/TOCropViewController

  • [x] I have read this issue template and provided all possible information.
  • [x] I'm using CocoaPods and have run pod update before filing this issue.

Hardware / Software

Which version of the library were you using? 2.0.12
Which version of iOS are you running? 10.3.2
What model of iOS device were you testing on? iPhone 5s
If using CocoaPods, which version of CocoaPods are you on? 1.2.0

Goals

Crop images to fixed aspect ration of 1:1 (square images). I therefore set aspectRatioLockEnabled and aspectRatioPreset. This should also be preserved after pressing undo.

Expected Results

The user is only allowed to crop the image with a square aspect ratio. Also after pressing undo.

Actual Results

The crop view is locked to square aspect ratio as long as the user does not press undo. Once he does press undo the crop view does loose its square lock.

Steps to Reproduce

Configure crop view controller to only allow square aspect ratio:

let cropViewController = TOCropViewController(image: pickedImage)
cropViewController.aspectRatioLockEnabled = true
cropViewController.aspectRatioPickerButtonHidden = true
cropViewController.aspectRatioPreset = .presetSquare
  • Play with the crop selection
  • Press undo
  • Now the crop selection is no longer locked to a square aspect ratio

Most helpful comment

I just realised this can be fixed by setting

cropViewController.resetAspectRatioEnabled = false

>All comments

I just realised this can be fixed by setting

cropViewController.resetAspectRatioEnabled = false

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TimOliver picture TimOliver  ·  4Comments

agusguerra10 picture agusguerra10  ·  5Comments

felipebonezi picture felipebonezi  ·  6Comments

trr-amsiq picture trr-amsiq  ·  10Comments

Srosman picture Srosman  ·  3Comments