I have a problem when applying rotationEffect to a map in in SwiftUI. The legal text in the map is transformed as shown in this image:
The following code is part of a much larger and complex view; it is a minimal example to reproduce the error:
import SwiftUI
import MapKit
struct ContentView: View {
@State private var offset = CGSize.zero
var body: some View {
ZStack {
let drag = DragGesture()
.onChanged { g in
offset.width = g.translation.width
offset.height = g.translation.height
}
Map(interactionModes: [.zoom])
.frame(width: 320, height: 220)
.rotationEffect(.degrees(Double(offset.width / 12)))
.highPriorityGesture(drag)
}
}
}
I hope you can help me with this problem.