Skip to content

Commit

Permalink
Fixed transparent circle hole rendering (Closes #1691, closes #1711)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Nov 2, 2016
1 parent 8ba3707 commit 37f21a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/Charts/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,14 @@ 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)
rect.origin.x = pt.x - circleHoleRadius
rect.origin.y = pt.y - circleHoleRadius
rect.size.width = circleHoleDiameter
rect.size.height = circleHoleDiameter
context.addEllipse(in: rect)

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

1 comment on commit 37f21a1

@liuxuan30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we add more lines of code to fix this? I think my PR is shorter, just stick to addArc :)

Please sign in to comment.