Skip to content

Commit

Permalink
[MODIFY] reduce maxinumZoomScale
Browse files Browse the repository at this point in the history
  • Loading branch information
c-nguyen committed Apr 5, 2018
1 parent 9258492 commit 3f206ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@ class FMCropScrollView: UIScrollView {
let scaleHeight = scrollViewFrame.size.height / image.size.height
let minimumScale = min(scaleWidth, scaleHeight)

// self.minimumZoomScale = minimumScale
// self.maximumZoomScale = max(minimumScale, self.maximumZoomScale)

self.minimumZoomScale = minimumScale
self.maximumZoomScale = max(minimumScale, self.maximumZoomScale)

if minimumScale > 1 {
self.maximumZoomScale = minimumScale
} else {
self.maximumZoomScale = min(1, minimumScale * 3)
}

self.zoomScale = minimumZoomScale

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ class FMScalingImageView: UIScrollView {
let minimumScale = min(scaleWidth, scaleHeight)

self.minimumZoomScale = minimumScale
self.maximumZoomScale = max(minimumScale, self.maximumZoomScale)

if minimumScale > 1 {
self.maximumZoomScale = minimumScale
} else {
self.maximumZoomScale = min(1, minimumScale * 3)
}

self.zoomScale = minimumZoomScale

Expand Down

0 comments on commit 3f206ca

Please sign in to comment.