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

move isDrawCirclesEnabled check further up in code to avoid creating … #4050

Merged
merged 2 commits into from
Nov 11, 2019
Merged
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
13 changes: 8 additions & 5 deletions Source/Charts/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ open class LineChartRenderer: LineRadarRenderer
continue
}


// Skip Circles and Accessibility if not enabled,
// reduces CPU significantly if not needed
if !dataSet.isDrawCirclesEnabled
{
continue
}

// Accessibility element geometry
let scaleFactor: CGFloat = 3
let accessibilityRect = CGRect(x: pt.x - (scaleFactor * circleRadius),
Expand All @@ -621,11 +629,6 @@ open class LineChartRenderer: LineRadarRenderer
accessibilityOrderedElements[i].append(element)
}

if !dataSet.isDrawCirclesEnabled
{
continue
}

context.setFillColor(dataSet.getCircleColor(atIndex: j)!.cgColor)

rect.origin.x = pt.x - circleRadius
Expand Down