mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
fix compass labels
This commit is contained in:
parent
bac376edcb
commit
7e4fb0a154
1 changed files with 3 additions and 3 deletions
|
|
@ -100,8 +100,7 @@ struct CompassView: View {
|
|||
|
||||
// Cardinal and intercardinal labels
|
||||
ForEach(CompassLabel.allLabels, id: \.degrees) { label in
|
||||
CompassLabelView(label: label, radius: dialRadius - 28)
|
||||
.rotationEffect(.degrees(-locationsHandler.heading))
|
||||
CompassLabelView(label: label, radius: dialRadius - 28, heading: locationsHandler.heading)
|
||||
}
|
||||
|
||||
// North triangle indicator at 0°
|
||||
|
|
@ -257,13 +256,14 @@ struct CompassLabel {
|
|||
struct CompassLabelView: View {
|
||||
let label: CompassLabel
|
||||
let radius: CGFloat
|
||||
let heading: Double
|
||||
|
||||
var body: some View {
|
||||
Text(label.text)
|
||||
.font(.system(size: label.isCardinal ? 18 : 13,
|
||||
weight: label.isCardinal ? .bold : .medium))
|
||||
.foregroundColor(label.degrees == 0 ? .orange : .primary)
|
||||
.rotationEffect(.degrees(-label.degrees))
|
||||
.rotationEffect(.degrees(-label.degrees + heading))
|
||||
.offset(y: -radius)
|
||||
.rotationEffect(.degrees(label.degrees))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue