File tree Expand file tree Collapse file tree
crates/lambda-platform/src/winit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,14 +81,28 @@ pub struct WindowHandle {
8181// Should we take the loop as a field right here? Probably a ref or something? IDK
8282pub struct WindowHandleBuilder {
8383 window_handle : Option < Window > ,
84- size : Option < WindowSize > ,
84+ size : WindowSize ,
8585 monitor_handle : Option < MonitorHandle > ,
8686}
8787
8888impl WindowHandleBuilder {
8989 /// Instantiate an empty builder
9090 pub fn new ( ) -> Self {
91- return Self ;
91+ // Initialize the window size with some default values.
92+ let logical: LogicalSize < u32 > = [ 0 , 0 ] . into ( ) ;
93+ let physical = logical. to_physical ( 1.0 ) ;
94+ let size = WindowSize {
95+ width : 0 ,
96+ height : 0 ,
97+ logical,
98+ physical,
99+ } ;
100+
101+ return Self {
102+ window_handle : None ,
103+ size,
104+ monitor_handle : None ,
105+ } ;
92106 }
93107
94108 /// Set the window size for the WindowHandle
You can’t perform that action at this time.
0 commit comments