chore: set path line join style

This commit is contained in:
CMK 2021-10-18 19:00:55 +08:00
parent 5b2cdea193
commit 3e9290c5a6
2 changed files with 3 additions and 6 deletions

View File

@ -94,14 +94,11 @@ extension LineChartView {
if let last = points.last {
dotPath.addArc(withCenter: last, radius: 3, startAngle: 0, endAngle: 2 * .pi, clockwise: true)
}
// this not works
// linePath.lineJoinStyle = .round
// lineShapeLayer.lineJoin = .round
lineShapeLayer.lineWidth = 3
lineShapeLayer.strokeColor = Asset.Colors.brandBlue.color.cgColor
lineShapeLayer.fillColor = UIColor.clear.cgColor
lineShapeLayer.lineJoin = .round
lineShapeLayer.lineCap = .round
lineShapeLayer.path = linePath.cgPath

View File

@ -16,7 +16,7 @@ class CurveAlgorithm {
private func controlPointsFrom(points: [CGPoint]) -> [CurvedSegment] {
var result: [CurvedSegment] = []
let delta: CGFloat = 0.4
let delta: CGFloat = 0.2
// only use horizontal control point
for i in 1..<points.count {