         
         
         ctx.setLineWidth(w)
-        ctx.setLineCap(.round)
+        ctx.setLineCap(progressStyle.lineCap)
         
         
         // Draw backdrop circle

        super.init(layer: layer)
        setup()
    }

    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setup()

    /// Values outside the [0,1] range will be clamped.
    @IBInspectable open var shadowOpacity: CGFloat {
        get {
            return ringProgressLayer.endShadowOpacity
        }
        set {
            ringProgressLayer.endShadowOpacity = newValue
        }
    }
    
    /// The Antialiasing switch. Defaults to `true`.
    @IBInspectable open var allowsAntialiasing: Bool {
        get {
            return ringProgressLayer.allowsAntialiasing
        }
        set {
            ringProgressLayer.allowsAntialiasing = newValue
        }
    }
    
    /// The style of the progress line end. Defaults to `round`.
    open var style: ProgressStyle {
        get {
            return ringProgressLayer.progressStyle
        }
        set {
            ringProgressLayer.progressStyle = newValue
        }
    }
    
