Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #143 from jeroenleenarts/patch-1
Browse files Browse the repository at this point in the history
When comparing the size of the image and the imageview's size. The origin of the image view should not be considered.
  • Loading branch information
nlutsenko committed Sep 10, 2015
2 parents 5cd9faf + 6f3aef9 commit 4282c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ParseUI/Classes/Cells/PFCollectionViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (void)layoutSubviews {

// Adapt content mode of _imageView to fit the image in bounds if the layout frame is smaller or center if it's bigger.
if (!CGRectIsEmpty(imageViewFrame)) {
if (CGRectContainsRect(PFRectMakeWithSize(_imageView.image.size), imageViewFrame)) {
if (CGRectContainsRect(PFRectMakeWithSize(_imageView.image.size), PFRectMakeWithSize(imageViewFrame.size))) {
_imageView.contentMode = UIViewContentModeScaleAspectFit;
} else {
_imageView.contentMode = UIViewContentModeCenter;
Expand Down

0 comments on commit 4282c57

Please sign in to comment.