Description
When a Text view with a background is displayed as the root content of a full-screen iPhone app, OpenSwiftUI incorrectly applies the root safe-area insets while resolving the centered view in its local coordinate space.
Because the text is centered and does not touch any safe-area edge, those insets should not affect its bounds. The incorrect adjustment expands the resolved text container and its red background vertically.
SwiftUI preserves the intrinsic bounds of the text for the same code.
This issue may not be visible in a smaller fixed-size snapshot, such as 200 × 200, because the incorrect safe-area adjustment is exposed by a regular app-sized layout.
Reproduction
import OpenSwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.background(Color.red)
}
}
Expected behavior
The red background should tightly match the intrinsic bounds of the text, as it does with SwiftUI.
Actual behavior
OpenSwiftUI expands the red background vertically into a large rectangle while the text remains centered inside it.

Description
When a
Textview with a background is displayed as the root content of a full-screen iPhone app, OpenSwiftUI incorrectly applies the root safe-area insets while resolving the centered view in its local coordinate space.Because the text is centered and does not touch any safe-area edge, those insets should not affect its bounds. The incorrect adjustment expands the resolved text container and its red background vertically.
SwiftUI preserves the intrinsic bounds of the text for the same code.
This issue may not be visible in a smaller fixed-size snapshot, such as
200 × 200, because the incorrect safe-area adjustment is exposed by a regular app-sized layout.Reproduction
Expected behavior
The red background should tightly match the intrinsic bounds of the text, as it does with SwiftUI.
Actual behavior
OpenSwiftUI expands the red background vertically into a large rectangle while the text remains centered inside it.