Skip to content

Commit 4699847

Browse files
committed
Fixed missing self in piechartrow
1 parent 6c768ad commit 4699847

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.swiftpm/xcode/xcuserdata/samuandris.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>SwiftUICharts.xcscheme_^#shared#^_</key>
88
<dict>
99
<key>orderHint</key>
10-
<integer>0</integer>
10+
<integer>3</integer>
1111
</dict>
1212
</dict>
1313
</dict>

Sources/SwiftUICharts/PieChart/PieChartRow.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public struct PieChartRow : View {
4343
ZStack{
4444
ForEach(0..<self.slices.count){ i in
4545
PieChartCell(rect: geometry.frame(in: .local), startDeg: self.slices[i].startDeg, endDeg: self.slices[i].endDeg, index: i, backgroundColor: self.backgroundColor,accentColor: self.accentColor)
46-
.scaleEffect(currentTouchedIndex == i ? 1.1 : 1)
46+
.scaleEffect(self.currentTouchedIndex == i ? 1.1 : 1)
4747
.animation(Animation.spring())
4848
}
4949
}
@@ -53,13 +53,13 @@ public struct PieChartRow : View {
5353
let isTouchInPie = isPointInCircle(point: value.location, circleRect: rect)
5454
if isTouchInPie {
5555
let touchDegree = degree(for: value.location, inCircleRect: rect)
56-
currentTouchedIndex = slices.firstIndex(where: { $0.startDeg < touchDegree && $0.endDeg > touchDegree }) ?? -1
56+
self.currentTouchedIndex = self.slices.firstIndex(where: { $0.startDeg < touchDegree && $0.endDeg > touchDegree }) ?? -1
5757
} else {
58-
currentTouchedIndex = -1
58+
self.currentTouchedIndex = -1
5959
}
6060
})
6161
.onEnded({ value in
62-
currentTouchedIndex = -1
62+
self.currentTouchedIndex = -1
6363
}))
6464
}
6565
}

0 commit comments

Comments
 (0)