mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 01:10:09 +00:00
Fix chart line rendering
This commit is contained in:
parent
fce2702c50
commit
0eec0642e3
@ -68,7 +68,8 @@ class LinesChartRenderer: BaseChartRenderer {
|
|||||||
context.setAlpha(alpha)
|
context.setAlpha(alpha)
|
||||||
context.setStrokeColor(toLine.color.cgColor)
|
context.setStrokeColor(toLine.color.cgColor)
|
||||||
context.setLineWidth(lineWidth)
|
context.setLineWidth(lineWidth)
|
||||||
context.setLineCap(.round)
|
|
||||||
|
context.beginTransparencyLayer(auxiliaryInfo: nil)
|
||||||
|
|
||||||
if linesShapeAnimator.isAnimating {
|
if linesShapeAnimator.isAnimating {
|
||||||
let animationOffset = linesShapeAnimator.current
|
let animationOffset = linesShapeAnimator.current
|
||||||
@ -315,9 +316,8 @@ class LinesChartRenderer: BaseChartRenderer {
|
|||||||
lines.removeLast()
|
lines.removeLast()
|
||||||
}
|
}
|
||||||
|
|
||||||
context.beginTransparencyLayer(auxiliaryInfo: nil)
|
context.setLineCap(.round)
|
||||||
context.strokeLineSegments(between: lines)
|
context.strokeLineSegments(between: lines)
|
||||||
context.endTransparencyLayer()
|
|
||||||
} else {
|
} else {
|
||||||
if var index = toLine.points.firstIndex(where: { $0.x >= range.lowerBound }) {
|
if var index = toLine.points.firstIndex(where: { $0.x >= range.lowerBound }) {
|
||||||
var lines: [CGPoint] = []
|
var lines: [CGPoint] = []
|
||||||
@ -433,9 +433,11 @@ class LinesChartRenderer: BaseChartRenderer {
|
|||||||
lines.removeLast()
|
lines.removeLast()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.setLineCap(.round)
|
||||||
context.strokeLineSegments(between: lines)
|
context.strokeLineSegments(between: lines)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
context.endTransparencyLayer()
|
||||||
context.setAlpha(1.0)
|
context.setAlpha(1.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user