Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Commit d2e96b9

Browse files
committed
Fixed default minimum scale when cropping
1 parent 0ceaf82 commit d2e96b9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

ALCameraViewController/ViewController/ConfirmViewController.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,13 @@ public class ConfirmViewController: UIViewController, UIScrollViewDelegate {
163163
}
164164

165165
guard let image = imageView.image else {
166-
return 1
166+
return 1
167167
}
168168

169169
let scaleWidth = _size.width / image.size.width
170170
let scaleHeight = _size.height / image.size.height
171-
172-
var scale: CGFloat
173-
174-
if croppingParameters.isEnabled {
175-
scale = max(scaleWidth, scaleHeight)
176-
} else {
177-
scale = min(scaleWidth, scaleHeight)
178-
}
179-
180-
return scale
171+
172+
return min(scaleWidth, scaleHeight)
181173
}
182174

183175
private func calculateScrollViewInsets(_ frame: CGRect) -> UIEdgeInsets {

0 commit comments

Comments
 (0)