Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit be80988

Browse files
authored
cap image heights (#1418)
1 parent dac6316 commit be80988

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Views/BoundedImageSize.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import UIKit
1111
func BoundedImageSize(originalSize: CGSize, containerWidth: CGFloat) -> CGSize {
1212
guard originalSize.width > containerWidth else { return originalSize }
1313
let ratio = originalSize.width / originalSize.height
14-
return CGSize(width: containerWidth, height: ceil(containerWidth / ratio))
14+
return CGSize(width: containerWidth, height: min(ceil(containerWidth / ratio), 300))
1515
}

0 commit comments

Comments
 (0)