Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bofei Zhu committed Nov 14, 2016
1 parent 6c9df5e commit d2f4f5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/IGListAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,25 @@ - (void)scrollToObject:(id)object
for (UICollectionViewLayoutAttributes *attribute in attributes) {
const CGRect frame = attribute.frame;
CGFloat originMin;
CGFloat originMax;
CGFloat endMax;
switch (scrollDirection) {
case UICollectionViewScrollDirectionHorizontal:
originMin = CGRectGetMinX(frame);
originMax = CGRectGetMaxX(frame);
endMax = CGRectGetMaxX(frame);
break;
case UICollectionViewScrollDirectionVertical:
originMin = CGRectGetMinY(frame);
originMax = CGRectGetMaxY(frame);
endMax = CGRectGetMaxY(frame);
break;
}

// find the minimum origin value of all the layout attributes
if (attribute == attributes.firstObject || originMin < offsetMin) {
offsetMin = originMin;
}

if (attribute == attributes.firstObject || originMax > offsetMax) {
offsetMax = originMax;
// find the maximum end value of all the layout attributes
if (attribute == attributes.firstObject || endMax > offsetMax) {
offsetMax = endMax;
}
}

Expand Down

0 comments on commit d2f4f5f

Please sign in to comment.