Skip to content

Commit 7791f69

Browse files
authored
Merge pull request #90 from thomasdao/master
Fix scrollView zoom to infinity warning
2 parents 2db4cb4 + ace681c commit 7791f69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/ImageViewerController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ class ImageViewerController:UIViewController, UIGestureRecognizerDelegate {
222222
extension ImageViewerController {
223223

224224
func updateMinMaxZoomScaleForSize(_ size: CGSize) {
225+
if imageView.bounds.width == 0 || imageView.bounds.height == 0 {
226+
return
227+
}
228+
225229
let minScale = min(
226230
size.width/imageView.bounds.width,
227231
size.height/imageView.bounds.height)

0 commit comments

Comments
 (0)