Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
fix code style
  • Loading branch information
liuxuan30 authored Jan 31, 2019
1 parent 59547e6 commit eb42a9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Charts/Renderers/PieChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,12 @@ open class PieChartRenderer: DataRenderer

if dataSet.valueLineColor != nil

This comment has been minimized.

Copy link
@jjatie

jjatie Jan 31, 2019

Collaborator

if let valueLineColor = dataSet.valueLineColor //...

{
if dataSet.useValueColorForLine {
if dataSet.useValueColorForLine

This comment has been minimized.

Copy link
@jjatie

jjatie Jan 31, 2019

Collaborator

I would prefer

let strokeColor = dataSet.useValueColorForLine
    ? dataSet.color(atIndex: j).cgColor
    : dataSet.valueLineColor!.cgColor
context.setStrokeColor(strokeColor)

It makes it more clear what’s changing in the two different cases

{
context.setStrokeColor(dataSet.color(atIndex: j).cgColor)
} else {
}
else
{
context.setStrokeColor(dataSet.valueLineColor!.cgColor)
}
context.setLineWidth(dataSet.valueLineWidth)
Expand Down

0 comments on commit eb42a9f

Please sign in to comment.