Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1. M_PI_2 is Pi / 2, not Pi * 2;
2. clockwise in UIKit and CoreGraphics is flipped;
3. using even odd rule to fill between two arcs
  • Loading branch information
liuxuan30 committed Oct 25, 2016
1 parent 8ef870a commit 33f63ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Charts/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,10 @@ open class LineChartRenderer: LineRadarRenderer
context.addEllipse(in: rect)

// Cut hole in path
context.addArc(center: pt, radius: circleHoleRadius, startAngle: 0.0, endAngle: CGFloat(M_PI_2), clockwise: true)
context.addArc(center: pt, radius: circleHoleRadius, startAngle: 0.0, endAngle: CGFloat(M_PI * 2), clockwise: false)

// Fill in-between
context.fillPath()
context.fillPath(using: .evenOdd)
}
else
{
Expand Down

0 comments on commit 33f63ac

Please sign in to comment.