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

Commit 6f3aef9

Browse files
When comparing the size of the image and the imageview's size. The origin of the image view should not be considered.
I have noticed that when positioning a imageView in a cell on another location unintended behavior occurs due to the fact that even though the image could be contained within the bounds of the imageview, the CGContainsRect call "fails" because the origin places one or more corners of the imageview frame outside of the generated imageView rect.
1 parent 8767f4d commit 6f3aef9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ParseUI/Classes/Cells/PFCollectionViewCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (void)layoutSubviews {
5656

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

0 commit comments

Comments
 (0)