Merge pull request #79 from alexsanderkhitev/master
the second try to fix the #68 bug
This commit is contained in:
commit
e5b2be2b44
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "SKPhotoBrowser"
|
||||
s.version = "1.7.9"
|
||||
s.version = "1.8.0"
|
||||
s.summary = "Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift2.0."
|
||||
s.homepage = "https://github.com/suzuki-0000/SKPhotoBrowser"
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
|
|
|
|||
|
|
@ -120,12 +120,14 @@ public class SKZoomingScrollView: UIScrollView, UIScrollViewDelegate, SKDetectin
|
|||
var maxScale: CGFloat!
|
||||
|
||||
let deviceScreenWidth = UIScreen.mainScreen().bounds.width
|
||||
let deviceScreenHeight = UIScreen.mainScreen().bounds.height
|
||||
|
||||
if photoImageView.frame.width < deviceScreenWidth {
|
||||
if deviceScreenWidth / 2 > photoImageView.frame.width {
|
||||
maxScale = 3.0
|
||||
// I think that we should to get coefficient between device screen width and image width and assign it to maxScale. I made two mode that we will get the same result for different device orientations.
|
||||
if UIApplication.sharedApplication().statusBarOrientation.isPortrait {
|
||||
maxScale = deviceScreenHeight / photoImageView.frame.width
|
||||
} else {
|
||||
maxScale = 2.0
|
||||
maxScale = deviceScreenWidth / photoImageView.frame.width
|
||||
}
|
||||
} else if photoImageView.frame.width > deviceScreenWidth {
|
||||
maxScale = 1.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue