ZImageCropper icon indicating copy to clipboard operation
ZImageCropper copied to clipboard

resetCrop does not reset paths

Open manfredcml opened this issue 4 years ago • 0 comments

I initialize a ZImageCropperView object as follow.

lazy var imageView: ZImageCropperView = {
  let v = ZImageCropperView()
  v.translatesAutoresizingMaskIntoConstraints = false
  v.isCropEnabled = true
  v.isUserInteractionEnabled = true
  v.strokeColor = UIColor.systemOrange
  return v
}()

Users can then draw on the image view. Upon clicking a UIButton, the following @objc function is invoked to reset the crop.

@objc func resetCrop(sender: UIButton) {
  imageView.resetCrop()
}

I expect the paths previously drawn by users will be reset upon invoking resetCrop on the image view object. However the paths remain. Is there method other than resetCrop to be called in order to clean all the drawn paths by users? Thanks.


Edit 1: Additional info: I tested in simulator (iOS 14.4). The UIImage in the image view is loaded via Kingfisher:

let url = "some_image_url"
imageView.kf.setImage(with: URL(string: url))

manfredcml avatar Feb 26 '21 15:02 manfredcml