File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
LXReorderableCollectionViewFlowLayout Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,9 @@ - (void)handleScroll:(CADisplayLink *)displayLink {
213213 CGSize frameSize = self.collectionView .bounds .size ;
214214 CGSize contentSize = self.collectionView .contentSize ;
215215 CGPoint contentOffset = self.collectionView .contentOffset ;
216- CGFloat distance = self.scrollingSpeed / LX_FRAMES_PER_SECOND;
216+ // 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);
217219 CGPoint translation = CGPointZero;
218220
219221 switch (direction) {
You can’t perform that action at this time.
0 commit comments