Skip to content

Commit 217da00

Browse files
author
JWI
committed
a
1 parent b2d3648 commit 217da00

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Sources/UIKitBackend/UIKitBackend+Container.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,15 @@ extension UIKitBackend {
125125
let view = widget.view
126126

127127
// Use bounds if non-zero, otherwise fallback to screen size
128-
let width = view.bounds.width > 0 ? view.bounds.width : UIScreen.main.bounds.width
129-
let height = view.bounds.height > 0 ? view.bounds.height : UIScreen.main.bounds.height
128+
let width = view?.bounds.width > 0 ? view.bounds.width : UIScreen.main.bounds.width
129+
let height = view?.bounds.height > 0 ? view.bounds.height : UIScreen.main.bounds.height
130130

131131
return SIMD2(Int(width.rounded(.awayFromZero)), Int(height.rounded(.awayFromZero)))
132132
}
133133

134-
135134
public func setSize(of widget: Widget, to size: SIMD2<Int>) {
136-
widget.width = 1000
137-
widget.height = 1000
135+
widget.width = size.x
136+
widget.height = size.y
138137
}
139138

140139
public func createScrollContainer(for child: Widget) -> Widget {

0 commit comments

Comments
 (0)