Skip to content

Commit

Permalink
Merge pull request #79 from alexsanderkhitev/master
Browse files Browse the repository at this point in the history
the second try to fix the #68 bug
  • Loading branch information
alexanderkhitev committed Apr 4, 2016
2 parents 494ed88 + 98ec4df commit e5b2be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SKPhotoBrowser.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
8 changes: 5 additions & 3 deletions SKPhotoBrowser/SKZoomingScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5b2be2

Please sign in to comment.