Skip to content

Commit

Permalink
fix lineWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
ykyouhei committed Jul 24, 2016
1 parent 5eb70b6 commit 71f1140
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions KYShutterButton/Classes/KYShutterButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,7 @@ public class KYShutterButton: UIButton {

lazy private var _arcLayer: CAShapeLayer = {
let layer = CAShapeLayer()
let path = UIBezierPath(
arcCenter: CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)),
radius: self.bounds.width/2 - self._arcWidth/2,
startAngle: -CGFloat(M_PI_2),
endAngle: CGFloat(M_PI*2.0) - CGFloat(M_PI_2),
clockwise: true
)
layer.path = path.CGPath
layer.path = self._arcPath.CGPath
layer.fillColor = UIColor.clearColor().CGColor
layer.strokeColor = self.arcColor.CGColor
layer.lineWidth = self._arcWidth
Expand Down Expand Up @@ -296,13 +289,15 @@ public class KYShutterButton: UIButton {
if _arcLayer.superlayer != layer {
layer.addSublayer(_arcLayer)
} else {
_arcLayer.path = _arcPath.CGPath
_arcLayer.path = _arcPath.CGPath
_arcLayer.lineWidth = _arcWidth
}

if _progressLayer.superlayer != layer {
layer.addSublayer(_progressLayer)
} else {
_progressLayer.path = p_arcPathWithProgress(1).CGPath
_progressLayer.path = p_arcPathWithProgress(1).CGPath
_progressLayer.lineWidth = _arcWidth/1.5
}

if _rotateLayer.superlayer != layer {
Expand Down

0 comments on commit 71f1140

Please sign in to comment.