From 431e03549b4d55244aa08f69f61281cb487d8525 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 6 Jan 2025 23:22:48 -0800 Subject: [PATCH] Revert "outrageous resize hack" This reverts commit 00dce54aead19fc3541965a7eaa40aa41494cd37. --- strafe-client/src/graphics_worker.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/strafe-client/src/graphics_worker.rs b/strafe-client/src/graphics_worker.rs index ce15298..6a6d469 100644 --- a/strafe-client/src/graphics_worker.rs +++ b/strafe-client/src/graphics_worker.rs @@ -14,9 +14,6 @@ WorkerDescription{ */ //up to three frames in flight, dropping new frame requests when all three are busy, and dropping output frames when one renders out of order -fn print(message:&str){ - web_sys::console::log_1(&message.into()); -} pub fn new<'a>( mut graphics:crate::graphics::GraphicsState, mut config:wgpu::SurfaceConfiguration, @@ -36,18 +33,10 @@ pub fn new<'a>( } Instruction::Render(frame_state)=>{ if let Some((size,user_settings))=resize.take(){ - print(format!("Resizing to {:?}",size).as_str()); + println!("Resizing to {:?}",size); //let t0=std::time::Instant::now(); - match size{ - winit::dpi::PhysicalSize{width:2560,height:1440}=>{ - config.width=size.width.clamp(1,2560); - config.height=size.height.clamp(1,1440); - }, - _=>{ - config.width=size.width.clamp(1,1280); - config.height=size.height.clamp(1,720); - } - } + config.width=size.width.clamp(1,2560/2); + config.height=size.height.clamp(1,1440/2); surface.configure(&device,&config); graphics.resize(&device,&config,&user_settings); //println!("Resize took {:?}",t0.elapsed());