We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f3033c1 + dd109b6 commit 997713eCopy full SHA for 997713e
1 file changed
LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m
@@ -213,7 +213,9 @@ - (void)handleScroll:(CADisplayLink *)displayLink {
213
CGSize frameSize = self.collectionView.bounds.size;
214
CGSize contentSize = self.collectionView.contentSize;
215
CGPoint contentOffset = self.collectionView.contentOffset;
216
- CGFloat distance = self.scrollingSpeed / LX_FRAMES_PER_SECOND;
+ // Important to have an integer `distance` as the `contentOffset` property automatically gets rounded
217
+ // and it would diverge from the view's center resulting in a "cell is slipping away under finger"-bug.
218
+ CGFloat distance = rint(self.scrollingSpeed / LX_FRAMES_PER_SECOND);
219
CGPoint translation = CGPointZero;
220
221
switch(direction) {
0 commit comments