Skip to content

Commit

Permalink
place content according to its degree. (#48)
Browse files Browse the repository at this point in the history
* fix: contents in Roulette is correctly placed. previously, content was not positioned according to its degree.

* fix: Demo
  • Loading branch information
fummicc1 authored Oct 5, 2023
1 parent d03f21e commit e66a70d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions Examples/Shared/DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ struct DemoApp: App {
var body: some Scene {
WindowGroup {
/// please change ``DemoApp/roulette`` and ``DemoApp/content``
roulette.navigationTitle(title)
// content
NavigationView {
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 e66a70d

Please sign in to comment.