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

When comparing the size of the image and the imageview's size. The origin of the image view should not be considered. #143

Merged
merged 1 commit into from
Sep 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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