     private var bottomSeparatorView: UIView?
     private var indicatorLayer: CAShapeLayer?
     private var selectedLayer: CAShapeLayer?
+    
+    private var isRTL: Bool {
+        if #available(iOS 9.0, *) {
+            return UIView.userInterfaceLayoutDirection(for: semanticContentAttribute) == .rightToLeft
+        } else {
+            return UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft
+        }
+    }
+    private var isFlipped = false
     
     // MARK: - Lifecycle
     

        // the collection view has reached the beginning or end
        startX = (item.collectionViewWidth / 2) - (cellWidth / 2 )
        
        var isFixedPosition = false
        if case .fixed = position {
            isFixedPosition = true
        }
        
        if spaceBefore < (item.collectionViewWidth - cellWidth) / 2 {
            startX = isFixedPosition && isRTL ? item.collectionViewWidth - spaceBefore - cellWidth : spaceBefore
        }
        if spaceAfter < (item.collectionViewWidth - cellWidth) / 2 {
            startX = isFixedPosition && isRTL ? spaceAfter : item.collectionViewWidth - spaceAfter - cellWidth
        }
        endX = startX + cellWidth
        


extension Segmentio.Points {
    
    init(item: Segmentio.ItemInSuperview, atIndex index: Int, allItemsCellWidth: [CGFloat], pointY: CGFloat, position: SegmentioPosition, style: SegmentioStyle, isCommonBehaviour: Bool) {
        let cellWidth = item.cellFrameInSuperview.width
        var startX = item.startX
        var endX = item.endX
