Skip to content

Commit

Permalink
Corrected pie isHighlightEnabled - render normally when disabled
Browse files Browse the repository at this point in the history
Fixes ChartsOrg#3996,
As that PR made normal slices render through highlight code, while disabling shift.
So special highlight colors or other styling - would still affect the normal rendering.
  • Loading branch information
danielgindi authored and SwiftPolar committed Mar 20, 2023
1 parent bc3b073 commit 4a4e06c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Charts/Renderers/PieChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ open class PieChartRenderer: DataRenderer
// draw only if the value is greater than zero
if (abs(e.y) > Double.ulpOfOne)
{
if !chart.needsHighlight(index: j)
if !dataSet.isHighlightEnabled || !chart.needsHighlight(index: j)
{
let accountForSliceSpacing = sliceSpace > 0.0 && sliceAngle <= 180.0

Expand Down Expand Up @@ -735,6 +735,8 @@ open class PieChartRenderer: DataRenderer
}

guard let set = data.getDataSetByIndex(indices[i].dataSetIndex) as? IPieChartDataSet else { continue }

if !set.isHighlightEnabled { continue }

let entryCount = set.entryCount
var visibleAngleCount = 0
Expand All @@ -761,7 +763,7 @@ open class PieChartRenderer: DataRenderer
let sliceAngle = drawAngles[index]
var innerRadius = userInnerRadius

let shift = set.isHighlightEnabled ? set.selectionShift : 0.0
let shift = set.selectionShift
let highlightedRadius = radius + shift

let accountForSliceSpacing = sliceSpace > 0.0 && sliceAngle <= 180.0
Expand Down

0 comments on commit 4a4e06c

Please sign in to comment.