File tree Expand file tree Collapse file tree
core/tauri-runtime-wry/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-runtime-wry " : patch
3+ ---
4+
5+ Fix ` window.center ` panic when window size is bigger than screen size.
Original file line number Diff line number Diff line change @@ -2476,8 +2476,8 @@ fn on_window_close<'a>(
24762476fn center_window ( window : & Window , window_size : WryPhysicalSize < u32 > ) -> Result < ( ) > {
24772477 if let Some ( monitor) = window. current_monitor ( ) {
24782478 let screen_size = monitor. size ( ) ;
2479- let x = ( screen_size. width - window_size. width ) / 2 ;
2480- let y = ( screen_size. height - window_size. height ) / 2 ;
2479+ let x = ( screen_size. width as i32 - window_size. width as i32 ) / 2 ;
2480+ let y = ( screen_size. height as i32 - window_size. height as i32 ) / 2 ;
24812481 window. set_outer_position ( WryPhysicalPosition :: new ( x, y) ) ;
24822482 Ok ( ( ) )
24832483 } else {
You can’t perform that action at this time.
0 commit comments