From 3e9290c5a608687f1212d623d33a456c4040d3e7 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 18 Oct 2021 19:00:55 +0800 Subject: [PATCH] chore: set path line join style --- Mastodon/Scene/Search/Search/View/LineChartView.swift | 7 ++----- Mastodon/Vender/CurveAlgorithm.swift | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Mastodon/Scene/Search/Search/View/LineChartView.swift b/Mastodon/Scene/Search/Search/View/LineChartView.swift index 51164034e..2fb8ac733 100644 --- a/Mastodon/Scene/Search/Search/View/LineChartView.swift +++ b/Mastodon/Scene/Search/Search/View/LineChartView.swift @@ -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 diff --git a/Mastodon/Vender/CurveAlgorithm.swift b/Mastodon/Vender/CurveAlgorithm.swift index 00db06048..0ca4c8734 100644 --- a/Mastodon/Vender/CurveAlgorithm.swift +++ b/Mastodon/Vender/CurveAlgorithm.swift @@ -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..