put clockwise into method

This commit is contained in:
Xinlei(Ryan) Pan 2020-01-16 16:43:16 -05:00
parent 36cbccd39c
commit b1abe0810c

View File

@ -132,8 +132,7 @@ open class DoughnutChart: View {
let arcCenter = shapeLayer.position
let radius = shapeLayer.bounds.size.width / 2.0 - lineWidth()/2.0
let clockwise = true
let value: CGFloat = chartModel.percent
let gap: CGFloat = spaceRequired() ? lineGap() : 0.0
let startAngle = ((prevPercent / 100.0) * 2 * .pi) - (0.5 * .pi)
@ -142,7 +141,7 @@ open class DoughnutChart: View {
radius: radius,
startAngle: startAngle,
endAngle: endAngle,
clockwise: clockwise)
clockwise: true)
shapeLayer.path = circlePath.cgPath
doughnutLayer.addSublayer(shapeLayer)