In a SwiftUI app for MacOS, vertical sliders that I'd created using a rotationEffect of 90° disappeared when I upgraded to Sonoma 14.5 (23F79). With rotations less than 90°, the slider is still visible, but its button is enlarged, growing in size as the rotation angle approaches 90°. Note that the sliders still work, even when rotated by 90° and invisible!
The screenshot and code below demonstrates the problem, which did not exist in MacOS 14.2.1
struct ContentView: View {
@State var speed = CGFloat(1)
var body: some View {
HStack {
let angle: [Double] = [0, 45, 80, 85, 90]
ZStack {
ForEach(0...4, id: \.self) { i in
ZStack () {
Rectangle()
Slider(value: $speed,
in: 0...10
)
}
.frame(width: 100, height: 10)
.rotationEffect(.degrees(angle[i]))
.offset(x: CGFloat(i * 100) - 180)
}
}
}
.padding()
.frame(width: 600, height: 200)
}
}
#Preview {
ContentView()
}