Skip to content

Commit b3cfc04

Browse files
committed
maybe part of letting scui dictate size?
1 parent 9bba11e commit b3cfc04

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/SwiftCrossUI/Backend/AppBackend.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ public protocol AppBackend: Sendable {
612612
/// Updates the content and appearance of a sheet.
613613
func updateSheet(
614614
_ sheet: Sheet,
615+
proposedSize: SIMD2<Int>,
615616
onDismiss: @escaping () -> Void
616617
)
617618

@@ -1266,6 +1267,7 @@ extension AppBackend {
12661267

12671268
public func updateSheet(
12681269
_ sheet: Sheet,
1270+
proposedSize: SIMD2<Int>,
12691271
onDismiss: @escaping () -> Void
12701272
) {
12711273
todo()

Sources/SwiftCrossUI/Views/Modifiers/SheetModifier.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ struct SheetModifier<Content: View, SheetContent: View>: TypeSafeView {
9191

9292
let _ = children.sheetContentNode.update(
9393
with: sheetContent(),
94-
proposedSize: backend.sizeOf(sheet),
94+
proposedSize: dryRunResult.size.idealSize,
9595
environment: sheetEnvironment,
9696
dryRun: false
9797
)
9898

9999
backend.updateSheet(
100100
sheet,
101+
proposedSize: dryRunResult.size.idealSize,
101102
onDismiss: handleDismiss
102103
)
103104

0 commit comments

Comments
 (0)