From a96a3314b07a543038f6c91fd4898b8cf1ba1fad Mon Sep 17 00:00:00 2001 From: MUISEROUX Fritzgerald Date: Wed, 1 Feb 2017 07:51:21 +0100 Subject: [PATCH] Fix progress Ring view size issue --- Source/ProgressRingView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/ProgressRingView.swift b/Source/ProgressRingView.swift index 206a795..60e6df6 100644 --- a/Source/ProgressRingView.swift +++ b/Source/ProgressRingView.swift @@ -128,10 +128,10 @@ public class ProgressRingView: UIView { let bigRadius = (bounds.width / 2.0) - lineWidth let centerRadius = bigRadius - lineWidth let valueRatio = ProgressRingView.valueRatio(minumum: minimumValue, maximum: maximumValue, value: value) - let theLayer = circleLayer(color: outterColor, radius: bigRadius, angle:(M_PI * 2 * valueRatio) - M_PI_2 , lineWith: lineWidth) + let theLayer = circleLayer(color: outterColor, radius: bigRadius, angle: M_PI * 2 * valueRatio, lineWith: lineWidth) layer.addSublayer(theLayer) - let theLayer2 = circleLayer(color: innerColor, radius: centerRadius, angle: (M_PI * 2) - M_PI_2, lineWith: lineWidth) + let theLayer2 = circleLayer(color: innerColor, radius: centerRadius, angle: M_PI * 2, lineWith: lineWidth) layer.addSublayer(theLayer2) @@ -211,7 +211,7 @@ extension CAShapeLayer { let circlePath = UIBezierPath(arcCenter: center, radius: radius, startAngle: CGFloat(-M_PI_2), - endAngle:CGFloat(maxAngle), + endAngle:CGFloat(maxAngle - M_PI_2), clockwise: clockwise) path = circlePath.cgPath frame = drawingFrame