diff --git a/UPCarouselFlowLayout/UPCarouselFlowLayout.swift b/UPCarouselFlowLayout/UPCarouselFlowLayout.swift index a4a5da1..33857e4 100644 --- a/UPCarouselFlowLayout/UPCarouselFlowLayout.swift +++ b/UPCarouselFlowLayout/UPCarouselFlowLayout.swift @@ -120,7 +120,7 @@ open class UPCarouselFlowLayout: UICollectionViewFlowLayout { let isHorizontal = (self.scrollDirection == .horizontal) let midSide = (isHorizontal ? collectionView.bounds.size.width : collectionView.bounds.size.height) / 2 - let proposedContentOffsetCenterOrigin = (isHorizontal ? proposedContentOffset.x : proposedContentOffset.y) + midSide + let proposedContentOffsetCenterOrigin = (isHorizontal ? proposedContentOffset.x + (proposedContentOffset.x * velocity.x) : proposedContentOffset.y + (proposedContentOffset.y * velocity.y)) + midSide var targetContentOffset: CGPoint if isHorizontal {