Skip to content

Commit

Permalink
Merge pull request #90 from thomasdao/master
Browse files Browse the repository at this point in the history
Fix scrollView zoom to infinity warning
  • Loading branch information
michaelhenry authored Feb 4, 2020
2 parents 2db4cb4 + ace681c commit 7791f69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/ImageViewerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ class ImageViewerController:UIViewController, UIGestureRecognizerDelegate {
extension ImageViewerController {

func updateMinMaxZoomScaleForSize(_ size: CGSize) {
if imageView.bounds.width == 0 || imageView.bounds.height == 0 {
return
}

let minScale = min(
size.width/imageView.bounds.width,
size.height/imageView.bounds.height)
Expand Down

0 comments on commit 7791f69

Please sign in to comment.