                 }
             } else if rightEdge(offset) {
                 if infiniteRightScroll || forced {
-                    return offset.x - contentOffsetCenter - contentInset.right
-                }
-            } else if contentOffsetRight == offset.x + CGFloat(pagingInset) {
-                if infiniteRightScroll || forced {
-                    return contentOffsetCenter - CGFloat(pagingInset)
+                    let offsetX = offset.x - contentOffsetRight
+                    return contentOffsetCenter + offsetX
                 }
             }
             

    
    func contentOffsetXAtPosition(position: Position) -> CGFloat? {
        if let view = contentViewAtPosition(position) {
            return view.frame.origin.x - pagingSpace
        }
        
        return nil

                fatalError(message)
            } catch {
                fatalError("IndexPath is out of range")
            }
            configureIndexPath = indexPath
        } else {
            if let section = forceSections().first {
