Skip to content

Commit

Permalink
fix: contents in Roulette is correctly placed. previously, content wa…
Browse files Browse the repository at this point in the history
…s not positioned according to its degree.
  • Loading branch information
fummicc1 committed Oct 5, 2023
1 parent d03f21e commit 0353ed1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions Examples/Shared/DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct DemoApp: App {
var body: some Scene {
WindowGroup {
/// please change ``DemoApp/roulette`` and ``DemoApp/content``
roulette.navigationTitle(title)
// content
// roulette.navigationTitle(title)
content
}
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/SimpleRoulette/Sources/Pie/RouletteInternalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ public struct RouletteInternalView: View {
}
}
ForEach(model.parts, id: \.self) { (part) -> ZStack in
let angle = ((part.endAngle + part.startAngle) / 2) + Angle(degrees: 90)
ZStack {
part.content.view
.rotationEffect(angle)
.offset(
CGSize(
width: { () -> Double in
Expand Down

0 comments on commit 0353ed1

Please sign in to comment.