From c6bfb03594c6b93e6822b030cc6a4c65076b75b4 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Thu, 10 Mar 2016 00:18:22 +0200 Subject: [PATCH] Fixed cubic fill causing borders on cubic stroke (Fixes #747) --- Charts/Classes/Renderers/LineChartRenderer.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Charts/Classes/Renderers/LineChartRenderer.swift b/Charts/Classes/Renderers/LineChartRenderer.swift index ac3872cdfd..6ccf509e6b 100644 --- a/Charts/Classes/Renderers/LineChartRenderer.swift +++ b/Charts/Classes/Renderers/LineChartRenderer.swift @@ -190,7 +190,10 @@ public class LineChartRenderer: LineRadarChartRenderer if (dataSet.isDrawFilledEnabled) { - drawCubicFill(context: context, dataSet: dataSet, spline: cubicPath, matrix: valueToPixelMatrix, from: minx, to: size) + // Copy this path because we make changes to it + let fillPath = CGPathCreateMutableCopy(cubicPath) + + drawCubicFill(context: context, dataSet: dataSet, spline: fillPath!, matrix: valueToPixelMatrix, from: minx, to: size) } CGContextBeginPath(context)