Skip to content

Commit

Permalink
Fix Photos that doesn't fill the view
Browse files Browse the repository at this point in the history
 Photos with lower-res doesn't fill view on iPhone 6 Plus
  • Loading branch information
Andrea committed Jun 25, 2015
1 parent 62eeeab commit 9e6c5ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KenBurns/JBKenBurnsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ - (float)getResizeRatioFromImage:(UIImage *)image width:(float)frameWidth height
{
heightDiff = frameHeight - image.size.height;

if (widthDiff > heightDiff)
if (widthDiff < heightDiff)
resizeRatio = frameWidth / image.size.width;
else
resizeRatio = self.bounds.size.height / image.size.height;
Expand All @@ -350,7 +350,7 @@ - (float)getResizeRatioFromImage:(UIImage *)image width:(float)frameWidth height
{
heightDiff = frameHeight - image.size.height;

if (widthDiff > heightDiff)
if (widthDiff < heightDiff)
resizeRatio = frameWidth / image.size.width;
else
resizeRatio = frameHeight / image.size.height;
Expand Down

0 comments on commit 9e6c5ec

Please sign in to comment.