File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,17 +202,15 @@ pub fn main() -> anyhow::Result<()> {
202202 ..
203203 } => match key {
204204 winit:: keyboard:: NamedKey :: Escape => event_loop_window_target. exit ( ) ,
205- winit:: keyboard:: NamedKey :: F5 => {
206- if !recompiling_shaders {
207- recompiling_shaders = true ;
208- let compiler_sender = compiler_sender. clone ( ) ;
209- thread:: spawn ( move || {
210- let shader_code = compile_shaders ( & options. shader )
211- . context ( "Compiling shaders failed" )
212- . unwrap ( ) ;
213- compiler_sender. try_send ( shader_code) . unwrap ( ) ;
214- } ) ;
215- }
205+ winit:: keyboard:: NamedKey :: F5 if !recompiling_shaders => {
206+ recompiling_shaders = true ;
207+ let compiler_sender = compiler_sender. clone ( ) ;
208+ thread:: spawn ( move || {
209+ let shader_code = compile_shaders ( & options. shader )
210+ . context ( "Compiling shaders failed" )
211+ . unwrap ( ) ;
212+ compiler_sender. try_send ( shader_code) . unwrap ( ) ;
213+ } ) ;
216214 }
217215 winit:: keyboard:: NamedKey :: ArrowUp
218216 | winit:: keyboard:: NamedKey :: ArrowDown => {
Original file line number Diff line number Diff line change @@ -262,14 +262,12 @@ async fn run(
262262 Event :: WindowEvent {
263263 event : WindowEvent :: Resized ( size) ,
264264 ..
265- } => {
266- if size. width != 0 && size. height != 0 {
267- // Recreate the swap chain with the new size
268- if let Ok ( ( surface, surface_config) ) = & mut surface_with_config {
269- surface_config. width = size. width ;
270- surface_config. height = size. height ;
271- surface. configure ( & device, surface_config) ;
272- }
265+ } if size. width != 0 && size. height != 0 => {
266+ // Recreate the swap chain with the new size
267+ if let Ok ( ( surface, surface_config) ) = & mut surface_with_config {
268+ surface_config. width = size. width ;
269+ surface_config. height = size. height ;
270+ surface. configure ( & device, surface_config) ;
273271 }
274272 }
275273 Event :: WindowEvent {
You can’t perform that action at this time.
0 commit comments