Skip to content

Commit

Permalink
move fill before stroke. if we fill after stroke, half of the stroke …
Browse files Browse the repository at this point in the history
…line width will be covered by the fill path.
  • Loading branch information
liuxuan30 committed Apr 27, 2016
1 parent 92f20fe commit 16930a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ public class LineChartRenderer: LineRadarChartRenderer
let minx = max(dataSet.entryIndex(entry: entryFrom) - diff, 0)
let maxx = min(max(minx + 2, dataSet.entryIndex(entry: entryTo) + 1), entryCount)

// if drawing filled is enabled
if (dataSet.isDrawFilledEnabled && entryCount > 0)
{
drawLinearFill(context: context, dataSet: dataSet, minx: minx, maxx: maxx, trans: trans)
}

CGContextSaveGState(context)

CGContextSetLineCap(context, dataSet.lineCapType)
Expand Down Expand Up @@ -456,12 +462,6 @@ public class LineChartRenderer: LineRadarChartRenderer
}

CGContextRestoreGState(context)

// if drawing filled is enabled
if (dataSet.isDrawFilledEnabled && entryCount > 0)
{
drawLinearFill(context: context, dataSet: dataSet, minx: minx, maxx: maxx, trans: trans)
}
}

public func drawLinearFill(context context: CGContext, dataSet: ILineChartDataSet, minx: Int, maxx: Int, trans: ChartTransformer)
Expand Down

0 comments on commit 16930a6

Please sign in to comment.