Goal: Match SwiftUI position coordinates with Figma.
Context: On Figma, the anchor is at the top leading of the layer. On SwiftUI, the anchor is at the center of the layer, as the documentation mentions:
/// - Returns: A view that fixes the center of this view at `x` and `y`.
@inlinable public func position(x: CGFloat = 0, y: CGFloat = 0) -> some View
So when both SwiftUI and Figma are set to x:0 and y:0 positions, they don't match.
Question: how can I set the anchor in SwiftUI to be at the top leading corner?
import SwiftUI
struct ContentView: View {
var body: some View {
ZStack {
Circle()
.frame(width: 132.0, height: 132.0)
.position(x: 0, y: 0)
}
.frame(width: 731, height: 418)
.background(.blue)
}
}

