     @IBInspectable public var trackCornerRadius: CGFloat = 0.0 {
         didSet {
             if trackCornerRadius * 2.0 > trackWidth || trackCornerRadius * 2.0 > trackHeight {
-                trackCornerRadius = min(trackWidth, trackHeight) / 2.0
+                trackCornerRadius = 0.5 * min(trackWidth, trackHeight)
             }
             updateTrackView()
         }

    @IBInspectable public var thumbCornerRadius: CGFloat = 0.0 {
        didSet {
            if thumbCornerRadius * 2.0 > thumbWidth || thumbCornerRadius * 2.0 > thumbHeight {
                thumbCornerRadius = min(thumbWidth, thumbHeight) / 2.0
            }
            updateThumbView()
        }

    private func updateThumbViewPosition() {
        let t = (value - minValue) / (maxValue - minValue)
        if isHorizontal {
            if minTrackImage == nil && maxTrackImage == nil {
                let thumbCenter = (trackWidth - thumbWidth) * CGFloat(t)
                thumbView.frame.origin = CGPoint(x: thumbCenter, y: 0.5 * (bounds.height - thumbHeight))
            } else {
                let thumbCenter = trackWidth * CGFloat(t) + minTrackImage!.size.width
                thumbView.frame.origin = CGPoint(x: thumbCenter - 0.5 * thumbWidth, y: 0.5 * (bounds.height - thumbHeight))
            }
        } else {
            if minTrackImage == nil && maxTrackImage == nil {
                let thumbCenter = (trackHeight - thumbHeight) * CGFloat(1 - t)
                thumbView.frame.origin = CGPoint(x: 0.5 * (bounds.width - thumbWidth), y: thumbCenter)
            } else {
                let thumbCenter = trackHeight * CGFloat(1 - t) + minTrackImage!.size.height
                thumbView.frame.origin = CGPoint(x: 0.5 * (bounds.width - thumbWidth), y: thumbCenter - 0.5 * thumbHeight)
            }
        }
    }
