Skip to content

Commit

Permalink
Fix issue #46
Browse files Browse the repository at this point in the history
  • Loading branch information
WenchaoD committed Jun 20, 2017
1 parent 731cf09 commit 23be29b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/FSPageViewLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class FSPagerViewLayout: UICollectionViewLayout {

var origin = startPosition
let maxPosition = self.scrollDirection == .horizontal ? min(rect.maxX,self.contentSize.width-self.actualItemSize.width-self.leadingSpacing) : min(rect.maxY,self.contentSize.height-self.actualItemSize.height-self.leadingSpacing)
while origin <= maxPosition {
// https://stackoverflow.com/a/10335601/2398107
while origin-maxPosition <= max(CGFloat(100.0) * .ulpOfOne * fabs(origin+maxPosition), .leastNonzeroMagnitude) {
let indexPath = IndexPath(item: itemIndex%self.numberOfItems, section: itemIndex/self.numberOfItems)
let attributes = self.layoutAttributesForItem(at: indexPath) as! FSPagerViewLayoutAttributes
self.applyTransform(to: attributes, with: self.pagerView?.transformer)
Expand Down

0 comments on commit 23be29b

Please sign in to comment.