Skip to content

Commit

Permalink
aligned center of cell instead of top edge when scrolling to JNWColle…
Browse files Browse the repository at this point in the history
…ctionViewScrollPositionMiddle
  • Loading branch information
Martin Hering committed Dec 31, 2014
1 parent a525105 commit 0baf57e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JNWCollectionView/JNWCollectionViewFramework.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ - (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(JNWCo
break;
case JNWCollectionViewScrollPositionMiddle:
// TODO
rect.origin.y -= ((CGRectGetHeight(visibleRect)-CGRectGetHeight(rect)) / 2.f);
rect.size.height = self.bounds.size.height;
rect.origin.y += (CGRectGetHeight(visibleRect) / 2.f) - CGRectGetHeight(rect);
break;
case JNWCollectionViewScrollPositionBottom:
// make the bottom of our rect flush with the bottom of the visible bounds
Expand Down

0 comments on commit 0baf57e

Please sign in to comment.