Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: Move fill before stroke for drawLinear() #982

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,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 @@ -461,12 +467,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