         return Int(distances.firstIndex(of: distances.min()!)!)
     }
     private func moveIndicatorView() {
-        indicatorView.frame = normalSegments[self.index].frame
+        indicatorView.frame = normalSegments[index].frame
         layoutIfNeeded()
+    }
+    private func updateCornerRadii() {
+        indicatorView.cornerRadius = cornerRadius - indicatorViewInset
+        segmentViews.forEach { $0.layer.cornerRadius = indicatorView.cornerRadius }
     }
     
     // MARK: Action handlers

    }
    /// The indicator view's inset. Defaults to `2.0`.
    @IBInspectable public var indicatorViewInset: CGFloat = 2.0 {
        didSet { setNeedsLayout() }
    }
    /// The indicator view's border width.
    @IBInspectable public var indicatorViewBorderWidth: CGFloat {

        // MARK: Lifecycle
        init() {
            super.init(frame: CGRect.zero)
            completeInit()
        }
        required public init?(coder aDecoder: NSCoder) {
            super.init(coder: aDecoder)
            completeInit()
        }
        private func completeInit() {
            segmentMaskView.backgroundColor = .black
        }
    }
