From 0baf57e749119eea3cf9527c3b6d33dbae5ec259 Mon Sep 17 00:00:00 2001 From: Martin Hering Date: Wed, 31 Dec 2014 10:02:52 +0100 Subject: [PATCH] aligned center of cell instead of top edge when scrolling to JNWCollectionViewScrollPositionMiddle --- JNWCollectionView/JNWCollectionViewFramework.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JNWCollectionView/JNWCollectionViewFramework.m b/JNWCollectionView/JNWCollectionViewFramework.m index 4692d21..f0587d3 100644 --- a/JNWCollectionView/JNWCollectionViewFramework.m +++ b/JNWCollectionView/JNWCollectionViewFramework.m @@ -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