From 3daa032370820d46a84e5eb9015ab5f17496f2c3 Mon Sep 17 00:00:00 2001 From: Artur Sulinski Date: Wed, 31 Oct 2018 11:23:25 +0100 Subject: [PATCH] Fix bug connected with scrolling vertically collection view --- UPCarouselFlowLayout/UPCarouselFlowLayout.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {